Strat AssistantStrat Assistant
This script will help you follow the strat. While other collections of scripts exist to do similar functionality, the idea of this (work in progress) is to be a one stop shop for all things strat that will evolve over time. Fairly new to the strat and pine script. The script is for informational purposes only. Please do you due diligence.
Features:
=Candle numbering: will number candles underneath based on the prior candle. 1 for an inside bar 2 for a directional bar (up or down) and 3 for an outside bar.
=Candle coloring: will highlight candles. Yellow for an inside candle, magenta for an outside candle, red for a 2 down candle, green for a 2 up candle. It will not modify the outside border of the candle so you can still see green if the open was lower than the close or red if the close was below open.
=Candle shape: will place an arrow up if the 2 candle is a directional UP and arrows down if the 2 candle is a directional DOWN. It will display red if it's bearish and green if it's bullish.
=Strat combos: will provide a text description of all currently applicable strat combinations if they are active at the top right of the chart. It will display red if it's bearish and green if it's bullish.
=Actionable signals: will provide text description of actionable signals if they are active on the bottom right of the chart. Inside bar if the bar is inside the prior bar, the color of this signal will be blue (shows better on white background). Hammer will be 75% of the candle is at the bottom and the open and close are above the 75% of the wick. Hammers will display green for bullish. Shooters are just the opposite of hammers, 75% of the wick is at the top and the open and close are below 75% of the wick. Shooters will display at red for bearish.
=Time Frame Continuity: will provide time frame continuity across 15m, 30m, Hour, Day, Week, Quarter, Year with green arrows up if the close is above the open for the given time frame, or red arrows down if the close is below the open for the given time frame. This will also look to determine if the time frame is applicable based on what time frame the user selects as well as ensures history exists for the given time frame.
Backlog / Work in progress:
=Opacity for time frame continuity
=Line indicators (or maybe just a label) for highs and lows of previous periods (hour, day, week, quarter)
=Alert conditions
=User input for various indicators
Search in scripts for "the script"
The MATRIX: Ultimate Crypto Position Strategy (Alert Version)Welcome back everyone,
It's been a while since our last post. In recent months we have worked on all kinds of projects, but more on that later. In the meantime, we also received a lot of positive feedback about our original 'The MATRIX: Ultimate Crypto Position Strategy' script.
One of the many requests was whether we could release an alert version.
However, since Pinescript does not provide the alert functionality in a strategy type script, it had to be converted to a study type script. Besides that, we have also added a stop-loss functionality. This release has the same internal algorithm as the original 'The MATRIX: Ultimate Crypto Position Strategy' script. But instead of showing back test results, this script provides the functionality to add alerts that can notify the user via email / pop-up / sms / app once a signal is given! You must manually add these alerts via TradingView. If you need help setting up these alerts, feel free to ask in the comment box or send us a dm.
***The script is invite-only, message us to get script access***
-------------------------------------------------------------------------------------------------
The MATRIX: Ultimate Crypto Position Strategy should be used as follows:
• The trading strategy was designed and optimized for trading cryptocurrencies only ; furthermore it works best on established high market cap cryptocurrencies that have a clear trend such as:
BTCUSD
ETHUSD
LTCUSD
XRMUSD
EOSUSD
ADAUSD
DASHUSD
ETCUSD
• The trading strategy is based on swing/position methodology. The script must therefore be used on daily timeframe candles only (1D).
• Use USD trading pairs only (e.g. use ETHUSD instead of the ETHBTC) since the individual trend is captured more effectively and therefore gives better results.
-------------------------------------------------------------------------------------------------
The MATRIX:Ultimate Crypto Position Strategy is based on the following indicators:
• Ichimoku Cloud ; acts as the leading indicator.
• Volume ; without strong volume , a market move is not valid.
• MACD and Vortex ; both being used as confirmation indicators.
• Choppiness index ; avoids trading in choppy markets.
• Bullish/ Bearish Regular Divergences in combination with RSI to spot tops and bottoms.
• Simple and Exponential Moving Averages ; prêvents trading against the trend.
The trading strategy is easy to use, trend based and without repainting, meaning once a signal has been made it is permanent and that no future data is used in the decision making. It detects the trend and filters out market noise based on more than 10 technical indicators. ONLY when all indicators align with each other the algorithm prints a BUY or SELL signal. The trading strategy provides high probability trading signals and minimizes risk! This script aims to capture the profit from longer term trending moves and by doing so filters out non-substantial trends and avoids the associated risks with these trades.
-------------------------------------------------------------------------------------------------
The MATRIX: Ultimate Crypto Position Strategy has the following features:
• ALERTS can be enabled which can notify the user through email/popup/app once a signal is given.
• Automatically generated Buy / Sell alerts in the form of a label.
• NO Repaint once candle is closed.
• SAFEGUARD ; custom built-in security prevẹnts trading when the price is out of equilibrium.
• Customizable Display for the Ichimoku cloud indicator display.
-------------------------------------------------------------------------------------------------
Reminder: Use this trading strategy at your own risk and trade responsibly. We are not responsible for any financial loss using this strategy.
***The script is invite-only, message us to get script access***
McGinley Dynamic (Improved) - John R. McGinley, Jr.For all the McGinley enthusiasts out there, this is my improved version of the "McGinley Dynamic", originally formulated and publicized in 1990 by John R. McGinley, Jr. Prior to this release, I recently had an encounter with a member request regarding the reliability and stability of the general algorithm. Years ago, I attempted to discover the root of it's inconsistency, but success was not possible until now. Being no stranger to a good old fashioned computational crisis, I revisited it with considerable contemplation.
I discovered a lack of constraints in the formulation that either caused the algorithm to implode to near zero and zero OR it could explosively enlarge to near infinite values during unusual price action volatility conditions, occurring on different time frames. A numeric E-notation in a moving average doesn't mean a stock just shot up in excess of a few quintillion in value from just "10ish" moments ago. Anyone experienced with the usual McGinley Dynamic, has probably encountered this with dynamically dramatic surprises in their chart, destroying it's usability.
Well, I believe I have found an answer to this dilemma of 'susceptibility to miscalculation', to provide what is most likely McGinley's whole hearted intention. It required upgrading the formulation with two constraints applied to it using min/max() functions. Let me explain why below.
When using base numbers with an exponent to the power of four, some miniature numbers smaller than one can numerically collapse to near 0 values, or even 0.0 itself. A denominator of zero will always give any computational device a horribly bad day, not to mention the developer. Let this be an EASY lesson in computational division, I often entertainingly express to others. You have heard the terminology "$#|T happens!🙂" right? In the programming realm, "AnyNumber/0.0 CAN happen!🤪" too, and it happens "A LOT" unexpectedly, even when it's highly improbable. On the other hand, numbers a bit larger than 2 with the power of four can tremendously expand rapidly to the numeric limits of 64-bit processing, generating ginormous spikes on a chart.
The ephemeral presence of one OR both of those potentials now has a combined satisfactory remedy, AND you as TV members now have it, endowed with the ever evolving "Power of Pine". Oh yeah, this one plots from bar_index==0 too. It also has experimental settings tweaks to play with, that may reveal untapped potential of this formulation. This function now has gain of function capabilities, NOT to be confused with viral gain of function enhancements from reckless BSL-4 leaking laboratories that need to be eternally abolished from this planet. Although, I do have hopes this imd() function has the potential to go viral. I believe this improved function may have utility in the future by developers of the TradingView community. You have the source, and use it wisely...
I included an generic ema() plot for a basic comparison, ultimately unveiling some of this algorithm's unique characteristics differing on a variety of time frames. Also another unconstrained function is included to display some the disparities of having no limitations on a divisor in the calculation. I strongly advise against the use of umd() in any published script. There is simply just no reason to even ponder using it. I also included notes in the script to warn against this. It's funny now, but some folks don't always read/understand my advisories... You have been warned!
NOTICE: You have absolute freedom to use this source code any way you see fit within your new Pine projects, and that includes TV themselves. You don't have to ask for my permission to reuse this improved function in your published scripts, simply because I have better things to do than answer requests for the reuse of this simplistic imd() function. Sufficient accreditation regarding this script and compliance with "TV's House Rules" regarding code reuse, is as easy as copying the entire function as is. Fair enough? Good! I have a backlog of "computational crises" to contend with, including another one during the writing of this elaborate description.
When available time provides itself, I will consider your inquiries, thoughts, and concepts presented below in the comments section, should you have any questions or comments regarding this indicator. When my indicators achieve more prevalent use by TV members, I may implement more ideas when they present themselves as worthy additions. Have a profitable future everyone!
GA - Value at RiskGA Value at Risk is a multifunctional tool. Its main purpose is to plot on the chart the Value at Risk . But it shows also integrated features related to the Volatility.
Value at Risk is a measure of the risk of loss for investments, given normal market conditions, in a period.
It measures and quantifies the level of financial risk. In this case, the risk is within position over a specific time frame.
Defining p as VaR, the probability of a loss greater than VaR is p, at most. Instead, the probability of loss that is less than VaR is 1-p, at least.
The VaR Breach occurs when a loss exceeds the VaR threshold .
For this case, VaR calculation uses the volatility estimation in a time interval. It defines the Probability Confidence according to the Normal Distribution. VaR is a percentile of the Normal Distribution. This is a multiplier of the Standard Deviation that define a Volatility Range.
The Normal Distribution Area around +- the Standard Deviation gives 68% of Confidence. 2 times the Standard Deviation returns a 95% of probability area. 3 time the Standard Deviation the Area returns 99.7% of Confidence.
Knowing VaR modeling, it is possible to determine the amount of a potential loss . Then, it is possible to know if there is enough capital to cover losses. In the same way, higher-than-acceptable risks forces reducing exposure in a financial instrument.
One of its practical use is to estimate the risk of an investment that is already at portfolio. Indeed, this is the purpose of the Value at Risk calculated in this script.
At the VaR Breach that investment has reached its worst scenario. Then, it can be the case to manage that investment into the balanced portfolio.
The Value at Risk does not tell when to enter the market.
Moving Averages
GA Value at Risk bases its calculations on a set of Moving Averages. Every feature of the script uses one of these Moving Averages for its algorithm.
Moving Averages from MA0 to MA8, are the core of each feature of the script.
By default, from MA0 to MA8, Moving Averages use the Fibonacci Series to define their lengths. This happens because of the power of the Golden Ratio in the market behavior.
Instead, the first moving average is an extra resource. Its purpose is to plot a Signal Line on the chart.
The script does not consider plotting every Moving Average on the chart. But it lets you enable the plotting of 7 Moving Averages (from MA0 to MA5 + Signal Line).
It is possible to select the Moving Average Formula to use in the script. This is a setting that affects every Moving Average. Then, it changes also the result of every feature of the script.
The selection is between:
Exponential Moving Average.
Simple Moving Average.
Weighted moving Average.
Simple Moving Averages and Pointers - Full Visibility
Moving Averages and Partial Visibility
The plotting of each Moving Average can be total or partial.
By default, the plotting of Moving Averages and Signal Line is partial.
When the price approaches a Moving Average a little part of the curve becomes visible. This highlights supports or resistances.
Besides, this tracking remains on the chart. Then it shows supports and resistances that the price reached during its progression.
The Partial Visibility Algorithm is a great advantage, ruling how to plot curves. It uses a parameter to set how much of the curves is to plot.
Exponential Moving Averages and Pointers - Partial Visibility
Exponential Moving Averages and Pointers - Full Visibility
Moving Averages and Pointers
As it is clear, it is not necessary to plot entire curves of Moving Averages on the chart. But it becomes relevant to plot Pointers to Moving Averages.
Indeed, the script plots horizontal segments that point to the latest Average Prices.
Every segment has a Label that shows Average Price, Length, and its related Moving Average (from MA0 to MA8). Besides, it is possible to extend the segment to right.
These pointers are a very useful automatization. They point to the Moving Averages. In this way, they show Dynamic Supports and Resistances as horizontal segments.
They are adaptive. Used together with the Volume Profile their progression approaches Edges of High Nodes.
This adaptive behavior makes easy to see when the price reaches Volume High Nodes and slows down.
Moving Average Pointers use the Partial Visibility Algorithm. In this case, the algorithm shows pointers with higher frequency than curves.
Moving Averages Pointers have:
Horizontal Segment as a Pointer with Arrow.
Label with details.
Circle to the current Average Price.
Weighted Moving Averages and Pointers - Full Visibility
Volatility Channels
Having Moving Averages, from MA0 to MA8, it is possible to plot 9 Volatility Channels.
Each Volatility Channel uses one of the Moving Averages, from MA0 to MA8.
Indeed, each Volatility Channel has the same designation of the Moving Average used.
The Standard Deviation defines the Volatility Range. It uses the length of the Moving Average related to the Volatility Channel.
The Volatility Range is unique for each Volatility Channel. In the same way, each Volatility Channel is unique because of its relation to only one Moving Average.
By default, each volatility channel has the 2 value as Standard Deviation Multiplier. This gives 95% of Confidence that the price will stay into the Volatility Range.
Using the Simple Moving Average, each Volatility Channel becomes a Bollinger Bands envelop.
Volatility Channels work very well even using Exponential or Weighted Moving Averages.
MA0 - Volatility Channel
Volatility Channels - From MA0 to MA8
Value at Risk (VaR)
GA Value at Risk plots VaR according to the volatility. The VaR plotting follows the Trend Momentum or Buying-Selling Waves.
By default, VaR follows the Trend Momentum by 2 times the Standard Deviation of MA0. Where MA0 is the first Moving Average and Volatility Channel of the set.
Besides, by default, the calculation of the Value at Risk is adaptive. It does not follow the Volatility Channel Bands. But it changes according to the fast reaction of the price into the Volatility Range.
By default, VaR follows the main momentum even if the price is moving in opposition to it. This occurs as long as the Trend Momentum persists.
In the settings box, It is possible to select the following of the latest Buying Wave or Selling Wave.
In this case, VaR changes according to the change of Buying Wave or Selling Wave. This means that, on these conditions, VaR follows main swings. Then it follows the weakening and the strengthening of the trend momentum as long as it persists.
The plotting of the Value at Risk can show these features:
Red cycle to show the Value at Risk at the current price.
Look Back Red Line that shows the progression of the Value at Risk.
Label with details.
MA0 - Value at Risk - Not Adaptive
MA0 - Value at Risk - Adaptive
It is possible to use a different Moving Average and Volatility Channel from the set. This affects the calculation and the plotting of the Value at Risk. In this way, the algorithm return the Value at Risk for the short, middle, or long-term.
Then, you can get the Value at Risk for that Financial Instrument, calculated for ~1 year or more so as for 1 month.
The Value at Risk does not tell you when to enter the market. Besides, it does not show you that the trend is changing.
MA3 - Value at Risk - Adaptive
Value at Profit (VaP)
The Value at Profit has a descriptive purpose. It points the Volatility Band that is opposite to the Value at Risk.
I chose Value at Profit as a designation for this feature. It does not tell you where to exit the market.
But is shows what the price progression is pointing on. This happens following the switching between Volatility Ranges.
The VaP follows the Volatility Band where the price tends to converge.
An outperforming or underperforming price is running faster than the average trend. Then when the price runs enough to converge to the Volatility Band, it is over extended or under extended.
At these conditions, the increased buying or selling pressure affects the price behavior. This slows down the price progression.
The Algorithm behind the Value at Profit is adaptive. Then the pointer jumps up and down the Volatility Bands of the 9 Volatility Channels. This occurs according to the price progression, following the switching between Volatility Ranges.
So, the VaP points a Volatility Band as long as the price can have chances to converges on it. Instead, when the price has chances to exceed the Volatility Band, the VaP points to the next one.
The plotting of the Value at Profit occurs enabling its Label with details.
Value at Profit - MA0 Volatility Channel Upper Band
Value at Profit - MA6 Volatility Channel Upper Band
Price Extension
When the price runs far away from the average trend price, GA Value at Risk can plot the price extension.
It shows the distance in percentage of the price from a Moving Average of the set. This tends to highlight conditions where the price is over or under extended.
An overbought or oversold condition precedes the shortening of the Trust. It is a cause of the hesitation of the price to continue its progression. This includes also Climactic Points and Signs of Dominance.
The Price Extension plotting uses a variation of the Partial Visibility Algorithm. It plots the Price Extension Arrow only when there are specific volatility conditions.
When the Partial Visibility is set to 0, the Price Extension Arrow is always visible on the chart.
The plotting of the Price Extension includes a Label with details.
Over Extension - The Price is Outperforming MA0
Under Extension - The Price is Underperforming MA0
Price Extension Coloring for Bars and Line Chart
GA Value at Risk lets you enable the coloring of vertical charts. Green and Red colors mark the over and under extended price on bars, candle sticks, and also on the Line Chart.
The Price Extension Algorithm colors Bars and Line Chart by a momentum function.
Indeed, the coloring happens following Relative Strength Index or Bollinger Bands %B.
These 2 Momentum functions are different. Indeed, they color the chart according to the purpose of their curves.
Coloring the Line Chart, it is necessary to put on front the script visibility.
Overbought and Oversold Conditions on Line Chart by Bollinger Bands %B
Overbought and Oversold Conditions on Candlesticks Chart by Relative Strength Index
Note: I restrict access to the tool. Use the links in my signature field to gain access to the script. Feel free to send me a PM for any question.
Thank you
Girolamo Aloe
Founder of Profiting Me Finance Analytics
-
Disclaimer
Nobody in Girolamo Aloe websites and trading view profile is a Financial Advisor. Nothing therein is intended to be constructed as Financial Advice. The content on his websites is for information and educational purposes only.
Trading carries high risk. You should not invest money that you cannot afford to lose. Past performance is not an indication of future results.
Confluence Engine [BullByte]CONFLUENCE ENGINE
Multi-Factor Technical Analysis Framework
OVERVIEW
Confluence Engine is a multi-dimensional technical analysis framework that evaluates market conditions across five distinct analytical pillars simultaneously. Rather than relying on a single indicator or signal source, this tool synthesizes Structure, Momentum, Volume, Volatility, and Pattern analysis into a unified scoring system that identifies high-probability trading opportunities when multiple technical factors align.
The core philosophy behind this indicator stems from a fundamental observation: isolated signals frequently fail, but when multiple independent analytical methods agree, the probability of a successful trade increases substantially. This indicator was developed after extensive research into why traders often receive conflicting signals from different indicators on their charts, leading to analysis paralysis and poor decision-making.
THE PROBLEM AND SOLUTION
The Problem:
Most traders use multiple indicators independently, often receiving contradictory signals. One indicator says "buy" while another says "wait." This creates confusion and leads to missed opportunities, premature entries based on incomplete analysis, difficulty quantifying how strong a setup actually is, and inconsistent decision-making across different market conditions.
The Solution:
Confluence Engine addresses this by providing a single, unified score (0-100) that represents the aggregate strength of a trading setup. Instead of mentally weighing five different indicators, traders receive a clear numerical score indicating setup quality, visual tier classification (ULTRA, HIGH, STANDARD), specific identification of which factors are strong or weak, and actionable guidance on what to watch for next.
THE FIVE ANALYTICAL DIMENSIONS
Each dimension was selected because it measures a fundamentally different aspect of market behavior:
STRUCTURE ANALYSIS
Evaluates price position relative to key levels and recent swing points. Markets respect structure - previous highs, lows, and areas where price reversed. This dimension identifies when price interacts with these critical levels and measures the quality of that interaction.
What it detects: Price approaching or sweeping swing highs/lows, reclaim patterns after false breakouts, EMA alignment and trend structure, exhaustion after extended moves.
MOMENTUM ANALYSIS
Measures the underlying strength and direction of price movement. Strong moves are characterized by momentum preceding price. This dimension evaluates whether momentum supports the current price direction.
What it detects: Oversold/overbought conditions with reversal potential, momentum divergence states, directional movement strength (ADX-based), momentum shifts before price confirmation.
VOLUME ANALYSIS
Volume validates price movement. Significant moves require participation. This dimension measures current volume relative to recent averages to determine if market participants are genuinely committing to the move.
What it detects: Volume spikes confirming price action, below-average volume warning of weak moves, climactic volume at potential reversals, volume confirmation of rejection patterns.
VOLATILITY ANALYSIS
Markets alternate between compression (low volatility) and expansion (high volatility). This dimension identifies these phases and recognizes when compression is likely to resolve into directional movement.
What it detects: Volatility squeeze conditions (Bollinger inside Keltner), squeeze release direction, ATR expansion indicating breakout potential, compression duration for timing breakouts.
PATTERN ANALYSIS
Candlestick patterns reflect the battle between buyers and sellers within each bar. This dimension evaluates the quality and context of reversal and continuation patterns.
What it detects: Engulfing patterns with quality scoring, hammer and shooting star formations, rejection wicks indicating trapped traders, pattern confluence with other factors.
WHAT MAKES THIS INDICATOR ORIGINAL Not a mashup
This is NOT a mashup of indicators displayed together. The Confluence Engine represents an integrated analytical framework with the following unique characteristics:
Unified Scoring System: All five dimensions feed into a proprietary scoring algorithm that weights and combines their signals. The output is a single 0-100 score, not five separate readings.
Multi-Factor Gate: Beyond just scoring, the system requires a minimum number of factors to be "active" (meeting their individual thresholds) before allowing signals. This prevents signals based on one extremely strong factor masking four weak ones.
Regime-Aware Adjustments: The engine detects the current market regime (trending, ranging, volatile, weak) and automatically adjusts factor weights and score multipliers. A structure signal means something different in a trending market versus a ranging market.
Adaptive Risk Management: Take-profit and stop-loss levels are not static. They adapt based on current volatility, market regime, and signal quality - providing tighter targets in low-volatility environments and wider targets when volatility expands.
Liquidity Sweep Detection: A distinctive feature that identifies when price has swept beyond a swing high/low and then reclaimed back inside. This pattern often indicates stop hunts followed by reversals.
Signal Quality Tiers: Rather than just "signal" or "no signal," the engine classifies setups into tiers. ULTRA (80+) represents highest probability setups with all factors aligned. HIGH (70-79) represents strong setups with multiple factors confirming. STANDARD meets minimum threshold for acceptable setups.
HOW THE SCORING WORKS
Each of the five factors generates a raw score from 0-100 based on current market conditions. These raw scores are then weighted according to the selected trading style (Balanced, Scalper, Swing, Range, Trend), adjusted based on current market regime detection, modified by higher timeframe alignment (if enabled), bonused when multiple factors exceed their activation thresholds simultaneously, and multiplied by session factors (if session filter is enabled).
The result is a final Bull Score and Bear Score, each ranging from 0-100, representing the current strength of long and short setups respectively.
Signal Generation Requirements:
- Score meets minimum threshold (configurable: 60-95)
- Required number of factors are "active" (default: 3 of 5)
- Market regime is not blocked (if blocking enabled)
- Higher timeframe alignment passes (if required)
- Cooldown period from last signal has elapsed
UNDERSTANDING THE DASHBOARDS
Main Dashboard (Top Right)
The main dashboard displays real-time scores and market context:
LONG Score - Current bullish setup strength (0-100) with quality tier displayed
SHORT Score - Current bearish setup strength (0-100) with quality tier displayed
Regime - Current market state showing TREND UP, TREND DN, VOLATILE, RANGE, or WEAK
HTF - Higher timeframe alignment showing BULL, BEAR, NEUT, or OFF
Squeeze - Volatility state showing SQZ (in squeeze), REL+ (bullish release), REL- (bearish release), or NORM
Gate - Factor count versus requirement, for example 4/3 means 4 factors active with 3 required
Sweep L/S - Liquidity sweep status for long and short setups
ATR% - Current ATR as percentile of recent range indicating relative volatility
Vol - Current volume relative to 20-period average
R:R - Current risk-reward ratio based on adaptive TP/SL calculations
Trade - Active trade status and unrealized profit/loss percentage
Analysis Dashboard (Bottom Left)
The analysis dashboard provides actionable guidance:
Signal Readiness - Visual progress bars showing how close each direction is to generating a signal
Blocking Factors - Identifies which specific factor is weakest and preventing signals
Recommended Action - Context-aware guidance such as WATCH, WAIT, MANAGE, or SCAN
Watch For - Specific events to monitor for setup completion
Opportunity Level - Overall market opportunity rating from EXCELLENT to VERY POOR
Timing - Contextual timing guidance based on current conditions
Status Bar (Bottom Center)
Compact view displaying Long Score, Gate Status, Current State, Gate Status, and Short Score in a single row for quick reference.
Dashboard Size - Auto Mode Explained
When Dashboard Size is set to "Auto", the indicator intelligently adjusts text size based on your current chart timeframe to optimize readability:
Auto-Sizing Logic:
1-Minute to 5-Minute Charts → Tiny
- Lower timeframes show more bars on screen
- Tiny text prevents dashboard from obscuring price action
- Recommended for scalping and high-frequency monitoring
15-Minute Charts → Small
- Balanced size for intraday trading
- Readable without being intrusive
1-Hour to Daily Charts → Normal
- Standard size for most trading styles
- Optimal readability for swing trading
Weekly and Monthly Charts → Large
- Larger text for position trading
- Fewer bars visible so space is available
Manual Override:
You can override auto-sizing for any dashboard individually:
- Dashboard Size (All): Sets master size applied to all dashboards
- Main Dashboard Size: Override for top-right dashboard specifically
- Analysis Panel Size: Override for bottom-left panel specifically
- Status Bar Size: Override for bottom-center bar specifically
Example Use Case:
Trading on 5m chart (default = Tiny) but you have good eyesight and large monitor:
- Set "Dashboard Size (All)" to "Small" or "Normal" for better readability
- Individual dashboards will use your override instead of auto-sizing
Recommendation:
Start with Auto mode and only adjust if dashboards are too large or too small for your monitor/eyesight.
UNDERSTANDING SIGNAL LABELS
When a signal generates, a label appears with trade information:
Minimal Style Example:
LONG 85
Shows tier icon, direction, and score only.
Detailed Style Example:
ULTRA LONG
Score: 85
Entry: 50250.50
TP1: 50650.25
TP2: 51500.75
SL: 49850.25
R:R 1:2.5
Regime: TREND UP
HTF: BULL
Tier Icons Explained:
indicates ULTRA quality with score 80 or higher
indicates HIGH quality with score between 70 and 79
indicates STANDARD quality with score meeting minimum threshold
UNDERSTANDING TRADE ZONES
When a signal generates, visual elements appear on the chart:
Entry Line (Purple) marks the entry price level
TP1 Line (Blue Dashed) marks the first take-profit target
TP2 Line (Cyan Dashed) marks the final take-profit target
SL Line (Orange Dotted) marks the stop-loss level
Trade Zone Box shows shaded area from SL to TP2
These elements extend forward as price progresses. When TP1 is hit, its line becomes solid to indicate achievement. When the trade completes at either TP2 or SL, all elements are cleaned up and the entry label converts to a compact ghost label for historical reference.
Exit Labels Explained:
+X.XX% indicates first target reached with partial profit secured
+X.XX% indicates full target reached with maximum profit achieved
-X.XX% indicates stop-loss triggered
TP1 Hit, SL... indicates stopped out after TP1 was already hit (optional display)
OPPOSITE SIGNAL HANDLING
When market conditions shift dramatically, the engine may generate a signal in the opposite direction while an existing trade is active. This represents a significant change in confluence and is handled automatically:
Automatic Trade Reversal Process:
1. Detection: New signal triggers opposite to current trade direction (e.g., SHORT signal while LONG trade is active)
2. Current Trade Closure:
- All visual elements (entry line, TP/SL lines, trade zone) are deleted
- Current trade is marked as closed
3. Entry Label Conversion:
- The detailed entry label is converted to a compact ghost label
- Ghost label shows direction + score (e.g., "LONG 75")
- Marked with "OPP" outcome to indicate opposite signal closure
- Moved to a non-interfering position below/above price
4. New Trade Initialization:
- Fresh entry label created for new direction
- New TP1, TP2, SL levels calculated based on new signal quality
- Trade zone and price lines drawn for new trade
Example Scenario:
You enter a LONG trade at score 72. Price moves sideways for 8 bars, then market structure breaks down. Confluence shifts heavily bearish with a sweep reclaim bear + momentum + volume spike, generating a SHORT signal at score 81. The engine automatically:
- Closes the LONG trade
- Converts "LONG 72" entry label to a small ghost label
- Opens new SHORT trade at current price
- Displays new SHORT entry label with full trade details
Trading Implication:
This behavior ensures the engine is always aligned with the highest-probability direction based on current confluence. It prevents you from holding a position when all five factors have flipped against you.
Note: This does NOT happen for every small score change. The opposite signal must meet all signal generation requirements (minimum score, gate pass, regime check, HTF alignment) before triggering. Typically occurs during strong trend reversals or major support/resistance breaks.
EXAMPLE TRADE : LONG
Instrument and Exchange: Bitcoin / TetherUS (BTC/USDT) on Binance
Timeframe: 5-minute
Timestamp: Nov 27, 2025 12:39 UTC
Indicator Script: Confluence Engine v1.0
Trade Type: Long (Example Trade)
Setting Used: Default
Signal Details:
- Tier: HIGH
- Score: 70
- Entry Price: 90040.70
- TP1 Target: 90868.63
- TP2 Target: 92110.52
- Stop Loss: 89325.94
- Risk Reward: 1:2.9
Trade Outcome:
- TP1 hit after 12 bars (+0.95%)
- TP2 hit after 28 bars (+2.85%)
- Total gain: +2.85% on full position
EXAMPLE TRADE : SHORT with Dashboard Explanation and interpretation
Instrument and Exchange: Ethereum / U.S. Dollar (ETH/USD) — Coinbase
Timeframe: 1-hour
Timestamp (screenshot): Nov 28, 2025 16:41 UTC
Indicator Script: Confluence Engine v1.0
Trade Type: Short (Example Trade)
Setting Used: Default
Signal Details
-Tier: STANDARD (STD)
-Score: 64
-Entry Price: 3037.26
-TP1 Target: 2981.61 (-55.65 pts)
-TP2 Target: 2898.12 (-139.14 pts)
-Stop Loss: 3099.79 (+62.53 pts)
-Risk:Reward: ≈ 1 : 2.2 (TP2/SL)
-Market Context at Signal
-Regime: TREND UP (contextual regime at time of signal) — mixed environment for shorts
-HTF Alignment: OFF (no higher-timeframe confirmation)
-Gate Status: 3 / 3 (minimum factor groups active — gate passed)
-Squeeze Status: NORM (no active compression breakout)
-Volume: ~1.8× average (elevated participation)
-ATR%: 57% (elevated volatility)
Analysis Dashboard Reading (what the user sees)
-Long Readiness: Needs +36 points to qualify.
-Short Readiness: Needs +11 points to qualify (closer but not auto-entering).
-Blocking Factors: Structure = 0 — the single decisive blocker preventing fresh signals.
-Opportunity Level: VERY POOR (roughly 20 / 100) — low quality environment for adding positions.
-Timing: Wait for better setup (do not add new positions).
-Trade Outcome (screenshot moment)
-Trade state: Active SHORT (opened earlier).
-Live P&L (snapshot): +0.14% (managing trade).
-TP1/TP2: Targets shown on chart (TP1 2981.61, TP2 2898.12). Not closed yet at screenshot.
-Visuals: Entry label, TP/SL lines and trade zone are displayed and being extended while trade is active.
Interpretation
The engine produced a standard short (Score 64) while the market showed elevated volume and volatility but no HTF confirmation. Although the Gate passed (3/3), Structure = 0 blocks the indicator from issuing fresh entries — this is intentional and by design: one missing factor (structure) is enough to prevent new signals even when other factors look supportive. The currently open short is being managed (partial targets and SL visible), but the system's recommendation is to manage the existing trade only and not open new shorts until structure or HTF alignment improves.
Why this example matters (teaching point)
-Gate ≠ Go: Gate pass (factor count) alone does not force fresh trades — the system enforces additional checks (structure, regime, HTF) to avoid lower-quality setups.
-Volume & Volatility are necessary but not sufficient: High volume and wide ATR create movement but do not replace structural validation.
-Active trade vs new entries: The script will continue to manage an already open trade but will not create a new signal while a blocking factor remains. This prevents overtrading and reduces false positives.
-Practical trader actions shown by the example
-Manage existing SHORT only: Trail to breakeven if TP1 is taken; scale out at TP1; hold remaining if price respects trend and structure reclaims.
-Do not add fresh positions: Wait for Structure > 0 or a HTF alignment that lifts the block.
-Watch for signals that matter: Sweep reclaim, HTF alignment turning bullish for shorts (i.e., HTF changes to BEAR), or a squeeze release with volume spike — these can clear the blocker and validate new entries.
RECOMMENDED TIMEFRAMES
For Scalping on 1m, 5m, or 15m charts: Use higher factor thresholds and shorter cooldowns. The faster pace requires stricter filtering.
For Day Trading on 15m, 30m, or 1H charts: This provides a balance of signal frequency and reliability suitable for most active traders.
For Swing Trading on 1H, 4H, or Daily charts: Expect higher quality signals with longer hold periods and fewer false signals.
For Position Trading on Daily or Weekly charts: Focus on ULTRA signals only for maximum conviction on longer-term positions.
Higher Timeframe Alignment Recommendations:
When trading 5m, use 1H as your HTF
When trading 15m, use 1H or 4H as your HTF
When trading 1H, use 4H or Daily as your HTF
When trading 4H, use Daily as your HTF
The general rule is to select an HTF that is 4 to 12 times your trading timeframe.
TRADING STYLE PRESETS
Balanced (Default)
Equal weighting across all five factors at 20% each. Suitable for most market conditions and recommended as starting point.
Scalper
Emphasizes Volume at 30% and Volatility at 30%. Designed for quick in-and-out trades on lower timeframes where immediate momentum and volatility expansion matter most.
Swing Trader
Emphasizes Structure at 30% and Momentum at 30%. Focuses on catching larger moves where trend direction and key levels are paramount.
Range Trader
Emphasizes Structure at 35% and Pattern at 25%. Optimized for sideways markets where support/resistance levels and reversal patterns dominate.
Trend Follower
Emphasizes Momentum at 40%. Designed for trending markets where staying with the dominant direction is the priority.
QUALITY MODE SETTINGS
Custom Mode
Set your own minimum score threshold. Lower thresholds between 60 and 65 generate more signals but with lower average quality. Higher thresholds of 75 or above generate fewer but higher-quality signals.
High Quality Mode
Uses minimum score of 70. Recommended for most users as it filters out marginal setups while still providing reasonable signal frequency.
Ultra Only Mode
Uses minimum score of 80 for maximum selectivity. Only the highest-conviction setups generate signals. Recommended for swing and position traders or during uncertain market conditions.
REGIME DETECTION
The engine continuously evaluates market conditions and classifies them into five states:
TREND UP
Characteristics: Strong ADX reading with EMAs aligned in bullish order
Trading Implications: Long signals receive score boost while short signals are suppressed. Momentum factor gains additional weight.
TREND DN
Characteristics: Strong ADX reading with EMAs aligned in bearish order
Trading Implications: Short signals receive score boost while long signals are suppressed. Momentum factor gains additional weight.
VOLATILE
Characteristics: High ATR percentile, wide Bollinger Bands, elevated volume
Trading Implications: Both directions remain viable but wider stops are recommended. Volume factor gains additional weight.
RANGE
Characteristics: Low ADX reading, narrow Bollinger Bands, low ATR percentile
Trading Implications: Structure signals are emphasized while momentum signals are suppressed. Pattern recognition becomes more important.
WEAK
Characteristics: Unclear or mixed conditions that do not fit other categories
Trading Implications: Reduced confidence in all signals. Consider waiting for clearer market conditions.
Filter Mode Options:
Off - Regime is detected and displayed but no score adjustments are applied
Adjust Scores - Automatically modifies factor weights based on current regime
Block Weak Regimes - Prevents signals from generating when regime is RANGE or WEAK
VOLATILITY SQUEEZE DETECTION
A volatility squeeze occurs when Bollinger Bands contract inside the Keltner Channel, indicating reduced volatility and potential energy building for a breakout.
Squeeze States Explained:
SQZ with bar count (example: SQZ 15)
Indicates currently in squeeze for the displayed number of bars. A score penalty is applied during this phase because compression represents uncertainty about direction.
REL+ (Release Bullish)
Indicates squeeze has released with price above the basis line. Score bonus is applied for long setups as this often precedes strong upward moves.
REL- (Release Bearish)
Indicates squeeze has released with price below the basis line. Score bonus is applied for short setups as this often precedes strong downward moves.
NORM (Normal)
No active squeeze detected. Standard scoring applies.
Trading Implication:
Squeeze releases often produce strong directional moves. The engine detects both the squeeze duration and the release direction, awarding bonus points to signals that align with the release. Longer squeeze duration often corresponds to more powerful breakouts.
LIQUIDITY SWEEP DETECTION
Markets often sweep beyond obvious support and resistance levels to trigger stops before reversing. The engine detects these patterns:
Bullish Sweep Reclaim
Price sweeps below recent swing low, triggering stop losses, then reclaims back above the swing low. This often indicates smart money accumulation after retail stops are collected.
Bearish Sweep Reclaim
Price sweeps above recent swing high, triggering stop losses, then reclaims back below the swing high. This often indicates smart money distribution after retail stops are collected.
Sweep Status in Dashboard:
RCL (Reclaim) - Reclaim has been confirmed. This receives highest structure score as the pattern is complete.
PND (Pending) - Sweep has occurred and price is near the level but full reclaim not yet confirmed. Watching for completion.
ACT (Active) - Sweep is currently in progress with price beyond the swing level.
Dash (-) - No sweep activity detected.
MULTI-FACTOR GATE SYSTEM
Beyond overall score, the engine counts how many individual factors meet their activation threshold.
Example Calculation:
Structure score 45 with threshold 35 equals ACTIVE
Momentum score 25 with threshold 30 equals INACTIVE
Volume score 50 with threshold 35 equals ACTIVE
Volatility score 40 with threshold 30 equals ACTIVE
Pattern score 35 with threshold 30 equals ACTIVE
Result: 4 of 5 factors are active
If minimum required factors is set to 3, this example passes the gate and receives a 4-factor bonus.
Gate Bonuses:
4 factors active adds 8 points to final score (default setting)
5 factors active adds 15 points to final score (perfect confluence)
Purpose:
This mechanism prevents scenarios where one extremely high factor score masks four weak factors. A score of 75 with only 2 active factors is less reliable than a score of 70 with 4 active factors.
ADAPTIVE RISK MANAGEMENT
Take-profit and stop-loss distances adjust dynamically based on three inputs:
Volatility Influence (default 40% weight)
Low ATR percentile produces tighter targets
High ATR percentile produces wider targets
This ensures stops are not too tight in volatile conditions or too wide in calm conditions.
Regime Influence (default 30% weight)
Trending market with aligned signal produces extended targets
Ranging market produces contracted targets
Volatile regime produces wider stops for protection
Score Influence (default 30% weight)
ULTRA signals (high conviction) receive extended targets
STANDARD signals receive standard targets
Higher conviction justifies larger profit expectations.
You can configure the weight of each influence in settings to match your trading style.
SESSION FILTER (Optional Feature)
When enabled, the engine applies score multipliers based on the trading session:
Asian Session (default 0.9x multiplier)
Characterized by lower volatility and ranging tendency. Score reduction reflects reduced opportunity.
London Session (default 1.1x multiplier)
Characterized by high volatility and trend initiation. Score boost reflects increased opportunity.
London/NY Overlap (default 1.2x multiplier)
Characterized by highest liquidity and strongest moves. Maximum score boost reflects peak trading conditions.
New York Session (default 1.05x multiplier)
Characterized by volatility but typically after initial moves have occurred.
Configure your UTC offset in settings to align session detection with your chart timezone.
ALERT SYSTEM
The indicator provides comprehensive alerts with dynamic data:
Signal Alerts:
- ULTRA Long Signal with full trade details
- ULTRA Short Signal with full trade details
- HIGH Long Signal with key levels
- HIGH Short Signal with key levels
- Any Long Signal with basic info
- Any Short Signal with basic info
Trade Management Alerts:
- TP1 Reached with profit percentage
- TP2 Full Target with total profit
- Stop Loss Hit with loss percentage and status
Technical Event Alerts:
- Squeeze Release
- Liquidity Sweep
- Perfect Confluence
- Regime Change
All alerts include actual calculated values such as score, entry price, target levels, stop level, and risk-reward ratio at the time of trigger.
AUTOMATIC SETTINGS VALIDATION
The indicator performs comprehensive validation when first loaded on a chart. If configuration errors are detected, a warning label appears on the chart with specific guidance.
Critical Errors (Prevent Signal Generation):
ULTRA threshold must exceed HIGH threshold
- Example error: HIGH = 75, ULTRA = 70
- Fix: Ensure ULTRA threshold is higher than HIGH threshold
- Default safe values: HIGH = 70, ULTRA = 80
Minimum factors cannot exceed 5
- The gate requires 3 to 5 factors (you cannot require 6 of 5 factors)
- Fix: Set minimum active factors to 3, 4, or 5
TP2 multiplier must exceed TP1 multiplier
- Example error: TP1 = 3.0 ATR, TP2 = 2.0 ATR
- Fix: Ensure TP2 (final target) is farther than TP1 (partial target)
- Default safe values: TP1 = 2.0, TP2 = 5.0
Swing lookback minimum is 3 bars
- Liquidity sweep detection requires at least 3 bars to identify swing highs/lows
- Fix: Increase swing lookback period to 3 or higher
ATR period minimum is 5 bars
- ATR calculation requires sufficient data for accuracy
- Fix: Increase ATR period to 5 or higher (14 recommended)
Higher timeframe must be larger than chart timeframe
- Example error: Trading on 1H chart with MTF set to 15m
- Fix: Select HTF that is 4-12x your chart timeframe
- Example: If trading 15m, use 1H or 4H as HTF
Warnings (Signal Generation Continues):
Score threshold below 50 generates many signals
- Lower thresholds increase signal frequency but reduce quality
- Recommendation: Use minimum 60 for active trading, 70+ for swing trading
Cooldown below 3 bars may cause signal clustering
- Very short cooldowns can produce multiple signals in quick succession
- Recommendation: Use 5+ bars for lower timeframes, 3+ for higher timeframes
Validation Label Display:
When errors are detected, a label appears at the top of the chart showing:
SETTINGS QUICK REFERENCE
Signal Quality Section:
Quality Mode: High Quality recommended for most users
Custom Minimum Score: Used when Quality Mode is set to Custom (range 30-95)
HIGH Threshold: Score required for HIGH tier classification (default 70)
ULTRA Threshold: Score required for ULTRA tier classification (default 80)
Regime Engine Section:
Enable Regime Detection: Activates automatic market state classification
Filter Mode: Off, Adjust Scores, or Block Weak Regimes
ADX Strong Threshold: ADX level indicating strong trend (default 25)
ADX Weak Threshold: ADX level indicating ranging conditions (default 15)
Show Regime Background: Displays subtle background color for current regime
Liquidity and Squeeze Section:
Enable Liquidity Sweep Detection: Activates sweep and reclaim pattern detection
Swing Lookback Period: Bars used to identify swing highs and lows (default 8)
Reclaim Threshold: Percentage of range price must reclaim after sweep (default 15%)
Enable Volatility Squeeze Detection: Activates Bollinger/Keltner squeeze detection
Keltner Channel Multiplier: Width multiplier for Keltner Channel (default 1.5)
Squeeze Penalty: Points subtracted during active squeeze (default 25)
Squeeze Release Bonus: Points added on squeeze release (default 20)
Enable Multi-Factor Gate: Requires minimum factors active before signaling
Minimum Active Factors: How many factors must meet threshold (default 3)
Individual Factor Thresholds: Customize activation threshold for each factor
4-Factor Bonus: Points added when 4 of 5 factors active (default 8)
5-Factor Bonus: Points added when all 5 factors active (default 15)
MTF Confluence Section:
Enable MTF Confluence: Activates higher timeframe trend analysis
Higher Timeframe: Select timeframe for trend alignment (recommend 4-12x chart TF)
Require HTF Alignment: Block signals opposing higher timeframe trend
Show HTF EMAs: Display higher timeframe EMA 21 and EMA 50 on chart
Trading Style Section:
Enable Style Weighting: Activates factor weight adjustments based on style
Trading Style: Balanced, Scalper, Swing Trader, Range Trader, or Trend Follower
Custom Weights: Individual weight sliders when fine-tuning is needed
Session Filter Section:
Enable Session Filter: Activates session-based score multipliers
Your UTC Offset: Your timezone offset for accurate session detection
Session Multipliers: Individual multipliers for Asian, London, New York, and Overlap sessions
Risk Parameters Section:
ATR Period: Period for Average True Range calculation (default 14)
TP1 ATR Multiple: First target distance as ATR multiple (default 2.0)
TP2 ATR Multiple: Final target distance as ATR multiple (default 5.0)
SL ATR Multiple: Stop loss distance as ATR multiple (default 2.0)
Enable Adaptive TP/SL: Activates dynamic adjustment based on conditions
Volatility Weight: Influence of ATR percentile on adaptive calculation (default 40%)
Regime Weight: Influence of market regime on adaptive calculation (default 30%)
Score Weight: Influence of signal score on adaptive calculation (default 30%)
Appearance Section:
Color Theme: Matrix (green/red), Dark (modern dark), or Light (clean light)
Label Detail: Minimal (score only), Standard (key info), or Detailed (full breakdown)
Dashboard Size Controls: Master size and individual overrides for each dashboard
Show Trade Zones: Display shaded box from SL to TP2 for active trades
Show TP/SL Labels: Display price labels on target and stop lines
Show Trailing Exit Labels: Display exit label when stopped after TP1 hit
Show Main Dashboard: Toggle main dashboard visibility (top right)
Show Analysis Dashboard: Toggle analysis panel visibility (bottom left)
Show Status Bar: Toggle compact status bar visibility (bottom center)
Performance Section:
Performance Mode: Reduces visual elements on lower timeframes automatically
Max Ghost Labels: Maximum historical signal labels to retain (default 50)
Signal Cooldown: Minimum bars between signals in same direction (default 5)
Enable Script Alerts: Controls whether alert() calls fire automatically (default ON)
- ON: Dynamic alerts with calculated values fire automatically
- OFF: alert() suppressed, alertcondition() still available for manual creation
- Use OFF when testing settings or monitoring multiple instruments visually
- Toggle per-chart for selective alert coverage across watchlist
Show Factor Markers: Display shapes on chart when 3, 4, or 5 factors align
Show Score Breakdown: Display detailed factor scores table in debug panel
Show Regime Debug: Display regime state and ADX value in debug panel
Show MTF Debug: Display higher timeframe status in debug panel
DEBUG MODE AND FACTOR MARKERS
The indicator includes optional debug tools for traders who want deeper insight into the scoring mechanics and factor analysis. These features are disabled by default to keep the chart clean but can be enabled in the Debug Mode settings group.
FACTOR MARKERS
When "Show Factor Markers" is enabled, visual shapes appear on the chart indicating confluence states:
Perfect Confluence (5/5 Factors Active)
A circle appears below the bar for bullish or above the bar for bearish setups. This represents maximum confluence where all five analytical dimensions meet their activation thresholds simultaneously. A small label showing "5/5" also appears. This is a rare occurrence and typically precedes the highest quality signals. Background color shifts to highlight this exceptional alignment.
Strong Confluence (4/5 Factors Active)
A diamond shape appears below the bar for bullish or above the bar for bearish setups. This represents strong confluence with four of five factors active. A label showing "4/5" appears when this state is first achieved. This level of confluence is associated with high-quality setups.
Ready Confluence (3/5 Factors Active)
A triangle appears below the bar (pointing up) for bullish or above the bar (pointing down) for bearish setups. This represents the minimum confluence level required when gate is set to 3 factors. No label appears for this level to reduce visual clutter.
Confluence Background
When factor markers are enabled, a subtle background color appears indicating the current confluence state. Stronger colors indicate higher confluence levels. Bullish confluence shows green tints while bearish confluence shows red tints.
Purpose of Factor Markers:
These markers help traders visualize when confluence is building before a signal triggers. You might see a 4/5 diamond appear one or two bars before the actual signal, giving you advance notice that conditions are aligning. This can help with preparation and timing.
DEBUG PANEL (Bottom Right)
When any debug option is enabled, a debug panel appears in the bottom right corner of the chart providing detailed scoring information.
Score Breakdown Table
When "Show Score Breakdown" is enabled, the panel displays:
Factor column showing Structure, Momentum, Volume, Volatility, and Pattern
Bull column showing raw score (0-100) for each bullish factor
Bear column showing raw score (0-100) for each bearish factor
Weight column showing current percentage weight for each factor
Below the factor rows :
FINAL row shows the calculated final Bull and Bear scores after all adjustments
Adj row shows total adjustments applied including gate bonus, squeeze adjustment, and exhaustion adjustment with positive or negative sign
This breakdown allows you to see exactly which factors are contributing to the score and which are lagging. If you notice Structure consistently low, you know to wait for better price positioning relative to swing levels.
Regime Debug
When "Show Regime Debug" is enabled, the panel displays:
Current regime state (TREND UP, TREND DN, VOLATILE, RANGE, WEAK)
Current ADX value driving the regime classification
This helps you understand why certain score adjustments are being applied and verify the regime detection is working as expected for current market conditions.
MTF Debug
When "Show MTF Debug" is enabled, the panel displays:
Current MTF alignment status (BULL, BEAR, NEUT)
The higher timeframe being analyzed
This confirms the higher timeframe data is being read correctly and shows you the trend bias from the larger timeframe perspective.
Using Debug Mode Effectively
For Learning: Enable all debug options when first using the indicator to understand how scores are calculated and what drives signal generation.
For Optimization: Use score breakdown to identify which factors are consistently weak in your chosen market and timeframe. This can inform whether to adjust factor thresholds or switch trading styles.
For Troubleshooting: If signals seem inconsistent, enable debug to see exactly what values the engine is working with. This helps identify if a specific factor is behaving unexpectedly.
For Live Trading: Disable debug features to keep chart clean and reduce visual distraction. The main dashboards provide sufficient information for trade execution.
Debug Settings Summary:
Show Factor Markers - Displays shapes on chart when 3, 4, or 5 factors align. Useful for seeing confluence build before signals trigger.
Show Score Breakdown - Displays detailed table with all raw factor scores, weights, and adjustments. Useful for understanding exactly how final score is calculated.
Show Regime Debug - Adds regime state and ADX value to debug panel. Useful for verifying regime detection accuracy.
Show MTF Debug - Adds higher timeframe status and timeframe to debug panel. Useful for confirming MTF data is loading correctly.
PERFORMANCE CONSIDERATIONS
On lower timeframes such as 1-minute and 5-minute charts, the indicator creates visual elements including labels, lines, and boxes that may impact performance on slower devices.
Performance Mode automatically reduces visual elements, optimizes calculation frequency, and limits historical ghost labels when enabled.
Configure Max Ghost Labels (default 50) to control how many historical signal labels are retained on the chart.
NON-REPAINTING DESIGN
Signal Integrity:
All entry and exit signals generate only on confirmed (closed) bars using barstate.isconfirmed checks. This ensures signals do not appear and disappear during bar formation.
Higher Timeframe Data:
MTF analysis uses request.security with lookahead disabled (barmerge.lookahead_off) to prevent future data from influencing current calculations.
Visual Elements:
Lines, boxes, and labels for active trades update in real-time for monitoring purposes but this visual updating does not affect signal generation logic. Entry decisions are made solely on confirmed bar data.
DISCLAIMER
Trading financial instruments involves substantial risk of loss and is not suitable for all investors. Past performance does not guarantee future results. This indicator is a technical analysis tool provided for educational purposes only. It does not constitute financial advice, trading recommendations, or solicitation to buy or sell any financial instrument.
The developer makes no representations regarding the accuracy of signals or the profitability of trading based on this indicator. Users assume full responsibility for their trading decisions and should conduct their own analysis before entering any trade.
Always use proper risk management. Never risk more than you can afford to lose. Consider consulting a qualified financial advisor before making trading decisions.
VERSION HISTORY
v1.0 - Initial Release
- Five-factor confluence scoring system
- Regime detection and automatic adaptation
- Liquidity sweep and reclaim detection
- Volatility squeeze state machine
- Multi-factor gate with bonus system
- Adaptive risk management
- Comprehensive alert system
- Three dashboard display panels
- Session filter with multipliers
- Multiple trading style presets
- Theme customization options
Developed by BullByte
Pine Script v6
2025
[CASH] Crypto And Stocks Helper (MultiPack w. Alerts)ATTENTION! I'm not a good scripter. I have just learned a little basics for this project, stolen code from other public scripts and modified it, and gotten help from AI LLM's.
If you want recognition from stolen code please tell me to give you the credit you deserve.
The script is not completely finished yet and contains alot of errors but my friends and family wants access so I made it public.
_________________________________________________________________________________
CASH has multiple indicators (a true all-in-one multipack), guides and alerts to help you make better trades/investments. It has:
- Bitcoin Bull Market Support Band
- Dollar Volume
- 5 SMA and 5 EMA
- HODL Trend (a.k.a SuperTrend) indicator
- RSI, Volume and Divergence indicators w. alerts
More to come as well, like Backburner and a POC line from Volume Profile.
Everything is fully customizable, appearance and off/on etc.
More information and explainations along with my guides you can find in settings under "Input" and "Style".
[blackcat] L1 Value Trend IndicatorOVERVIEW
The L1 Value Trend Indicator is a sophisticated technical analysis tool designed for TradingView users seeking advanced market trend identification and trading signals. This comprehensive indicator combines multiple analytical techniques to provide traders with a holistic view of market dynamics, helping identify potential entry and exit points through various signal mechanisms. 📈 It features a main Value Trend line along with a lagged version, golden cross and dead cross signals, and multiple technical indicators including RSI, Williams %R, Stochastic %K/D, and Relative Strength calculations. The indicator also includes reference levels for support and resistance analysis, making it a versatile tool for both short-term and long-term trading strategies. ✅
FEATURES
📈 Primary Value Trend Line: Calculates a smoothed value trend using a combination of SMA and custom smoothing techniques
🔍 Value Trend Lag: Implements a lagged version of the main trend line for cross-over analysis
🚀 Golden Cross & Dead Cross Signals: Identifies buy/sell opportunities when the main trend line crosses its lagged version
💸 Multi-Indicator Integration: Combines multiple technical analysis tools for comprehensive market view
📊 RSI Calculations: Includes 6-period, 7-period, and 13-period RSI calculations for momentum analysis
📈 Williams %R: Provides overbought/oversold conditions using the Williams %R formula
📉 Stochastic Oscillator: Implements both Stochastic %K and %D calculations for momentum confirmation
📋 Relative Strength: Calculates relative strength based on highest highs and current price
✅ Visual Labels: Displays BUY and SELL labels on chart when crossover conditions are met
📣 Alert Conditions: Provides automated alert conditions for golden cross and dead cross events
📌 Reference Levels: Plots entry (25) and exit (75) reference lines for support/resistance analysis
HOW TO USE
Copy the Script: Copy the complete Pine Script code from the original file
Open TradingView: Navigate to TradingView website or application
Access Pine Editor: Go to the Pine Script editor (usually found in the chart toolbar)
Paste Code: Paste the copied script into the editor
Save Script: Save the script with a descriptive name like " L1 Value Trend Indicator"
Select Chart: Choose the chart where you want to apply the indicator
Add Indicator: Apply the indicator to your chart
Configure Parameters: Adjust input parameters to customize behavior
Monitor Signals: Watch for golden cross (BUY) and dead cross (SELL) signals
Use Reference Levels: Monitor entry (25) and exit (75) lines for support/resistance levels
LIMITATIONS
⚠️ Potential Repainting: The script may repaint due to lookahead bias in some calculations
📉 Lookahead Bias: Some calculations may reference future values, potentially causing repainting issues
🔄 Parameter Sensitivity: Results may vary significantly with different parameter settings
📉 Computational Complexity: May impact chart performance with heavy calculations on large datasets
📊 Resource Usage: Requires significant processing power for multiple indicator calculations
🔄 Data Sensitivity: Results may be affected by data quality and market conditions
NOTES
📈 Signal Timing: Cross-over signals may lag behind actual price movements
📉 Parameter Optimization: Optimal parameters may vary by market conditions and asset type
📋 Market Conditions: Performance may vary significantly across different market environments
📈 Multi-Indicator: Combine signals with other technical indicators for confirmation
📉 Timeframe Analysis: Use multiple timeframes for enhanced signal accuracy
📋 Volume Analysis: Incorporate volume data for additional confirmation
📈 Strategy Integration: Consider using this indicator as part of a broader trading strategy
📉 Risk Management: Use signals as part of a comprehensive risk management approach
📋 Backtesting: Test parameter combinations with historical data before live trading
THANKS
🙏 Original Creator: blackcat1402 creates the L1 Value Trend Indicator
📚 Community Contributions: Recognition to TradingView community for continuous improvements and contributions
📈 Collaborative Development: Appreciation for collaborative efforts in enhancing technical analysis tools
📉 TradingView Community: Special thanks to TradingView community members for their ongoing support and feedback
📋 Educational Resources: Recognition of educational resources that helped in understanding technical analysis principles
Trend with ADX/EMA - Buy & Sell SignalsThis script is designed to help traders make buy and sell decisions based on trend analysis using two key methods: ADX (Average Directional Index) and EMA (Exponential Moving Averages). Here's a breakdown in simple terms:
What Does It Do?
Identifies the Trend's Strength and Direction:
Uses the ADX indicator to determine how strong the trend is.
Compares two lines (DI+ and DI−) to identify whether the trend is moving up or down.
Generates Buy and Sell Signals:
Uses two EMAs (a fast one and a slow one) to check when the price crosses key levels, signaling a possible buy or sell opportunity.
Plots visual indicators (arrows and labels) for easy interpretation.
Color-Codes the Chart:
Highlights the background in green when the trend is bullish (uptrend).
Highlights the background in red when the trend is bearish (downtrend).
Alerts the User:
Creates alerts when specific conditions for buying or selling are met.
Key Components:
1. ADX (Trend Strength & Direction)
What is ADX?
ADX measures how strong the trend is (not the direction). Higher ADX means a stronger trend.
It also calculates two lines:
DI+: Measures upward movement strength.
DI−: Measures downward movement strength.
How It Works in the Script:
If DI+ is greater than DI−, it’s a bullish trend (upward).
If DI− is greater than DI+, it’s a bearish trend (downward).
The background turns green for an uptrend and red for a downtrend.
2. EMA (Buy and Sell Decisions)
What is EMA?
EMA is a moving average that gives more weight to recent prices. It’s used to smooth out price fluctuations.
How It Works in the Script:
The script calculates two EMAs:
Fast EMA (short-term average): Reacts quickly to price changes.
Slow EMA (long-term average): Reacts slower and shows overall trends.
When the Fast EMA crosses above the Slow EMA, it’s a signal to Buy.
When the Fast EMA crosses below the Slow EMA, it’s a signal to Sell.
These signals are marked on the chart as "Buy" and "Sell" labels.
3. Buy and Sell Alerts
The script sets up alerts for the user:
Buy Alert: When a crossover indicates a bullish signal.
Sell Alert: When a crossunder indicates a bearish signal.
Visual Elements on the Chart:
Background Colors:
Green: When the DI+ line indicates an uptrend.
Red: When the DI− line indicates a downtrend.
EMA Lines:
Green Line: Fast EMA.
Red Line: Slow EMA.
Buy/Sell Labels:
"Buy" label: Shown when the Fast EMA crosses above the Slow EMA.
"Sell" label: Shown when the Fast EMA crosses below the Slow EMA.
Why Use This Script?
Trend Analysis: Helps you quickly identify the strength and direction of the market trend.
Buy/Sell Signals: Gives clear signals to enter or exit trades based on trend and EMA crossovers.
Custom Alerts: Ensures you never miss a trading opportunity by notifying you when conditions are met.
Visual Simplicity: Makes it easy to interpret trading signals with color-coded backgrounds and labeled arrows.
Volatility Signaling 50SMAOverview of the Script:
The script implements a volatility signaling indicator using a 50-period Simple Moving Average (SMA). It incorporates Bollinger Bands and the Average True Range (ATR) to dynamically adjust the SMA's color based on volatility conditions. Here's a detailed breakdown:
Components of the Script:
1. Inputs:
The script allows the user to customize key parameters for flexibility:
Bollinger Bands Length (length): Determines the period for calculating the Bollinger Bands.
Source (src): The price data to use, defaulting to the closing price.
Standard Deviation Multiplier (mult): Scales the Bollinger Bands' width.
ATR Length (atrLength): Sets the period for calculating the ATR.
The 50-period SMA length (smaLength) is fixed at 50.
2. Bollinger Bands Calculation:
Basis: Calculated as the SMA of the selected price source over the specified length.
Upper and Lower Bands: Determined by adding/subtracting a scaled standard deviation (dev) from the basis.
3. ATR Calculation:
Computes the Average True Range over the user-defined atrLength.
4. Volatility-Based Conditions:
The script establishes thresholds for Bollinger Band width relative to ATR:
Yellow Condition: When the band width (upper - lower) is less than 1.25 times the ATR.
Orange Condition: When the band width is less than 1.5 times the ATR.
Red Condition: When the band width is less than 1.75 times the ATR.
5. Dynamic SMA Coloring:
The 50-period SMA is colored based on the above conditions:
Yellow: Indicates relatively low volatility.
Orange: Indicates moderate volatility.
Red: Indicates higher volatility.
White: Default color when no conditions are met.
6. Plotting the 50-Period SMA:
The script plots the SMA (sma50) with a dynamically assigned color, enabling visual analysis of market conditions.
Use Case:
This script is ideal for traders seeking to assess market volatility and identify changes using Bollinger Bands and ATR. The colored SMA provides an intuitive way to gauge market dynamics directly on the chart.
Example Visualization:
Yellow SMA: The market is in a low-volatility phase.
Orange SMA: Volatility is picking up but remains moderate.
Red SMA: Higher volatility, potentially signaling significant market activity.
White SMA: Neutral/default state.
Previous High and Low Count with Probabilities + Risk On/Off1. Purpose of the Script:
This trading script combines two important concepts:
Previous High and Low Count: It tracks whether the current price exceeds the previous day’s high or low and calculates probabilities for the next price movement (up or down).
Risk On / Risk Off Indicator: It evaluates market sentiment through various indicators (such as the Fear & Greed Index, VIX, and others) and shows whether the market is in a risk-on or risk-off state. This information impacts the probabilities of price movement.
2. How it Works:
Previous High and Low:
The script tracks how often the price exceeds the previous day’s high or low and calculates the probability of an upward or downward movement based on that. This gives you an idea of how often the market reacts at the previous day's high or low.
Risk On / Risk Off:
Based on various market factors (Fear & Greed Index, VIX, Put-Call Ratio, etc.), the script calculates the Risk On or Risk Off state.
In Risk On, the probability of an upward movement increases, and the probability of a downward movement decreases. In Risk Off, it’s the opposite.
Adjusted Probabilities:
The probabilities for an Up or Down movement are adjusted based on the current Risk On / Risk Off state. In a Risk On environment, the probability for an upward move increases, while in a Risk Off environment, the probability for a downward move increases.
3. How to Use the Script:
Add the Script in TradingView:
TradingView:
Click on "Add to Chart" to apply the script to your chart.
Manual Input of Indicators:
For the Fear & Greed Index, VIX, and other indicators, you need to manually enter the current values. You can get these values from various publicly available sources:
Fear & Greed Index: CNN Fear & Greed Index
VIX (Volatility Index): VIX Index
Other indicators like Put-Call Ratio, Bitcoin Volatility, Oil Prices, and US Dollar Index can also be manually inputted, and they can be found on finance websites like Yahoo Finance, MarketWatch, and Bloomberg.
Observe the Colors and Symbols:
If the market is in a Risk On state, the background will turn green, and a green triangle will appear below the candle.
If the market is in a Risk Off state, the background will turn red, and a red triangle will appear above the candle.
Track the Probabilities:
A label will appear on the chart showing the calculated probabilities for Up and Down movements. These probabilities are adjusted based on the current market state (Risk On/Off).
4. Meaning of the Probabilities:
Up Probability: Indicates the probability that the price will rise.
Down Probability: Indicates the probability that the price will fall.
The probabilities are dynamic and adjust based on the Risk On / Risk Off state, helping you make better decisions based on the current market conditions.
Value at Risk [OmegaTools]The "Value at Risk" (VaR) indicator is a powerful financial risk management tool that helps traders estimate the potential losses in a portfolio over a specified period of time, given a certain level of confidence. VaR is widely used by financial institutions, traders, and risk managers to assess the probability of portfolio losses in both normal and volatile market conditions. This TradingView script implements a comprehensive VaR calculation using several models, allowing users to visualize different risk scenarios and adjust their trading strategies accordingly.
Concept of Value at Risk
Value at Risk (VaR) is a statistical technique used to measure the likelihood of losses in a portfolio or financial asset due to market risks. In essence, it answers the question: "What is the maximum potential loss that could occur in a given portfolio over a specific time horizon, with a certain confidence level?" For instance, if a portfolio has a one-day 95% VaR of $10,000, it means that there is a 95% chance the portfolio will not lose more than $10,000 in a single day. Conversely, there is a 5% chance of losing more than $10,000. VaR is a key risk management tool for portfolio managers and traders because it quantifies potential losses in monetary terms, allowing for better-informed decision-making.
There are several ways to calculate VaR, and this indicator script incorporates three of the most commonly used models:
Historical VaR: This approach uses historical returns to estimate potential losses. It is based purely on past price data, assuming that the past distribution of returns is indicative of future risks.
Variance-Covariance VaR: This model assumes that asset returns follow a normal distribution and that the risk can be summarized using the mean and standard deviation of past returns. It is a parametric method that is widely used in financial risk management.
Exponentially Weighted Moving Average (EWMA) VaR: In this model, recent data points are given more weight than older data. This dynamic approach allows the VaR estimation to react more quickly to changes in market volatility, which is particularly useful during periods of market stress. This model uses the Exponential Weighted Moving Average Volatility Model.
How the Script Works
The script starts by offering users a set of customizable input settings. The first input allows the user to choose between two main calculation modes: "All" or "OCT" (Only Current Timeframe). In the "All" mode, the script calculates VaR using all available methodologies—Historical, Variance-Covariance, and EWMA—providing a comprehensive risk overview. The "OCT" mode narrows the calculation to the current timeframe, which can be particularly useful for intraday traders who need a more focused view of risk.
The next input is the lookback window, which defines the number of historical periods used to calculate VaR. Commonly used lookback periods include 21 days (approximately one month), 63 days (about three months), and 252 days (roughly one year), with the script supporting up to 504 days for more extended historical analysis. A longer lookback period provides a more comprehensive picture of risk but may be less responsive to recent market conditions.
The confidence level is another important setting in the script. This represents the probability that the loss will not exceed the VaR estimate. Standard confidence levels are 90%, 95%, and 99%. A higher confidence level results in a more conservative risk estimate, meaning that the calculated VaR will reflect a more extreme loss scenario.
In addition to these core settings, the script allows users to customize the visual appearance of the indicator. For example, traders can choose different colors for "Bullish" (Risk On), "Bearish" (Risk Off), and "Neutral" phases, as well as colors for highlighting "Breaks" in the data, where returns exceed the calculated VaR. These visual cues make it easy to identify periods of heightened risk at a glance.
The actual VaR calculation is broken down into several models, starting with the Historical VaR calculation. This is done by computing the logarithmic returns of the asset's closing prices and then using linear interpolation to determine the percentile corresponding to the desired confidence level. This percentile represents the potential loss in the asset over the lookback period.
Next, the script calculates Variance-Covariance VaR using the mean and standard deviation of the historical returns. The standard deviation is multiplied by a z-score corresponding to the chosen confidence level (e.g., 1.645 for 95% confidence), and the resulting value is subtracted from the mean return to arrive at the VaR estimate.
The EWMA VaR model uses the EWMA for the sigma parameter, the standard deviation, obtaining a specific dynamic in the volatility. It is particularly useful in volatile markets where recent price behavior is more indicative of future risk than older data.
For traders interested in intraday risk management, the script provides several methods to adjust VaR calculations for lower timeframes. By using intraday returns and scaling them according to the chosen timeframe, the script provides a dynamic view of risk throughout the trading day. This is especially important for short-term traders who need to manage their exposure during high-volatility periods within the same day. The script also incorporates an EWMA model for intraday data, which gives greater weight to the most recent intraday price movements.
In addition to calculating VaR, the script also attempts to detect periods where the asset's returns exceed the estimated VaR threshold, referred to as "Breaks." When the returns breach the VaR limit, the script highlights these instances on the chart, allowing traders to quickly identify periods of extreme risk. The script also calculates the average of these breaks and displays it for comparison, helping traders understand how frequently these high-risk periods occur.
The script further visualizes the risk scenario using a risk phase classification system. Depending on the level of risk, the script categorizes the market as either "Risk On," "Risk Off," or "Risk Neutral." In "Risk On" mode, the market is considered bullish, and the indicator displays a green background. In "Risk Off" mode, the market is bearish, and the background turns red. If the market is neither strongly bullish nor bearish, the background turns neutral, signaling a balanced risk environment.
Traders can customize whether they want to see this risk phase background, along with toggling the display of the various VaR models, the intraday methods, and the break signals. This flexibility allows traders to tailor the indicator to their specific needs, whether they are day traders looking for quick intraday insights or longer-term investors focused on historical risk analysis.
The "Risk On" and "Risk Off" phases calculated by this Value at Risk (VaR) script introduce a novel approach to market risk assessment, offering traders an advanced toolset to gauge market sentiment and potential risk levels dynamically. These risk phases are built on a combination of traditional VaR methodologies and proprietary logic to create a more responsive and intuitive way to manage exposure in both normal and volatile market conditions. This method of classifying market conditions into "Risk On," "Risk Off," or "Risk Neutral" is not something that has been traditionally associated with VaR, making it a groundbreaking addition to this indicator.
How the "Risk On" and "Risk Off" Phases Are Calculated
In typical VaR implementations, the focus is on calculating the potential losses at a given confidence level without providing an overall market outlook. This script, however, introduces a unique risk classification system that takes the output of various VaR models and translates it into actionable signals for traders, marking whether the market is in a Risk On, Risk Off, or Risk Neutral phase.
The Risk On and Risk Off phases are primarily determined by comparing the current returns of the asset to the average VaR calculated across several different methods, including Historical VaR, Variance-Covariance VaR, and EWMA VaR. Here's how the process works:
1. Threshold Setting and Effect Calculation: The script first computes the average VaR using the selected models. It then checks whether the current returns (expressed as a negative value to signify loss) exceed the average VaR value. If the current returns surpass the calculated VaR threshold, this indicates that the actual market risk is higher than expected, signaling a potential shift in market conditions.
2. Break Analysis: In addition to monitoring whether returns exceed the average VaR, the script counts the number of instances within the lookback period where this breach occurs. This is referred to as the "break effect." For each period in the lookback window, the script checks whether the returns surpass the calculated VaR threshold and increments a counter. The percentage of periods where this breach occurs is then calculated as the "effect" or break percentage.
3. Dual Effect Check (if "Double" Risk Scenario is selected): When the user chooses the "Double" risk scenario mode, the script performs two layers of analysis. First, it calculates the effect of returns exceeding the VaR threshold for the current timeframe. Then, it calculates the effect for the lower intraday timeframe as well. Both effects are compared to the user-defined confidence level (e.g., 95%). If both effects exceed the confidence level, the market is deemed to be in a high-risk situation, thus triggering a Risk Off phase. If both effects fall below the confidence level, the market is classified as Risk On.
4. Risk Phases Determination: The final risk phase is determined by analyzing these effects in relation to the confidence level:
- Risk On: If the calculated effect of breaks is lower than the confidence level (e.g., fewer than 5% of periods show returns exceeding the VaR threshold for a 95% confidence level), the market is considered to be in a relatively safe state, and the script signals a "Risk On" phase. This is indicative of bullish conditions where the potential for extreme loss is minimal.
- Risk Off: If the break effect exceeds the confidence level (e.g., more than 5% of periods show returns breaching the VaR threshold), the market is deemed to be in a high-risk state, and the script signals a "Risk Off" phase. This indicates bearish market conditions where the likelihood of significant losses is higher.
- Risk Neutral: If the break effect hovers near the confidence level or if there is no clear trend indicating a shift toward either extreme, the market is classified as "Risk Neutral." In this phase, neither bulls nor bears are dominant, and traders should remain cautious.
The phase color that the script uses helps visualize these risk phases. The background will turn green in Risk On conditions, red in Risk Off conditions, and gray in Risk Neutral phases, providing immediate visual feedback on market risk. In addition to this, when the "Double" risk scenario is selected, the background will only turn green or red if both the current and intraday timeframes confirm the respective risk phase. This double-checking process ensures that traders are only given a strong signal when both longer-term and short-term risks align, reducing the likelihood of false signals.
A New Way of Using Value at Risk
This innovative Risk On/Risk Off classification, based on the interaction between VaR thresholds and market returns, represents a significant departure from the traditional use of Value at Risk as a pure risk measurement tool. Typically, VaR is employed as a backward-looking measure of risk, providing a static estimate of potential losses over a given timeframe with no immediate actionable feedback on current market conditions. This script, however, dynamically interprets VaR results to create a forward-looking, real-time signal that informs traders whether they are operating in a favorable (Risk On) or unfavorable (Risk Off) environment.
By incorporating the "break effect" analysis and allowing users to view the VaR breaches as a percentage of past occurrences, the script adds a predictive element that can be used to time market entries and exits more effectively. This **dual-layer risk analysis**, particularly when using the "Double" scenario mode, adds further granularity by considering both current timeframe and intraday risks. Traders can therefore make more informed decisions not just based on historical risk data, but on how the market is behaving in real-time relative to those risk benchmarks.
This approach transforms the VaR indicator from a risk monitoring tool into a decision-making system that helps identify favorable trading opportunities while alerting users to potential market downturns. It provides a more holistic view of market conditions by combining both statistical risk measurement and intuitive phase-based market analysis. This level of integration between VaR methodologies and real-time signal generation has not been widely seen in the world of trading indicators, marking this script as a cutting-edge tool for risk management and market sentiment analysis.
I would like to express my sincere gratitude to @skewedzeta for his invaluable contribution to the final script. From generating fresh ideas to applying his expertise in reviewing the formula, his support has been instrumental in refining the outcome.
Johnny's Moving Average RibbonProps to Madrid for creating the original script: Madrid Moving Average Ribbon.
All I did was upgrade it to pinescript v5 and added a few changes to the script.
Features and Functionality
Moving Average Types: The indicator offers a choice between exponential moving averages (EMAs) and simple moving averages (SMAs), allowing users to select the type that best fits their trading strategy.
Dynamic Color Coding: Each moving average line within the ribbon changes color based on its direction and position relative to a reference moving average, providing visual cues for market sentiment and trend strength.
Lime Green: Indicates an uptrend and potential long positions, shown when a moving average is rising and above the longer-term reference MA.
Maroon: Suggests caution for long positions or potential short reentry points, displayed when a moving average is rising but below the reference MA.
Ruby Red: Represents a downtrend, suitable for short positions, shown when a moving average is falling and below the reference MA.
Green: Signals potential reentry points for downtrends or warnings for uptrend reversals, displayed when a moving average is falling but above the reference MA.
Usage and Application
Trend Identification: Traders can quickly ascertain the market's direction at a glance by observing the predominant color of the ribbon and its orientation.
Trade Entry and Exit Points: The color transitions within the ribbon can signal potential entry or exit points, with changes from green to lime or red to maroon indicating shifts in market momentum.
Customization: Users have the flexibility to toggle between exponential and simple moving averages, allowing for a tailored analytical approach that aligns with their individual trading preferences.
Technical Specifications
The ribbon consists of multiple moving averages calculated over different periods, typically ranging from shorter to longer-term intervals to capture various aspects of market behavior.
The color dynamics are determined by comparing each moving average to a reference point, often a longer-term moving average within the ribbon, to assess the relative trend strength and direction.
Vola2vola Volatility indicatorHello everyone!
For those who remember vola2vola volatility script, we are excited to bring it back within the Myfractalrange Tradingview account!
As you know, Volatility is very important to assets and many people use it to trade. This tool automate the calculation of the volatility of every asset as well as provide an estimated value of its "Trend" and "Trade".
The idea in this script is to allow users to have an idea of the current volatility regime of the asset he is monitoring: Is its volatility Bullish or Bearish Trend, Bearish or Bullish Trade? Is its volatility compressed to a previous minimum value? Is it about to experience a spike in volatility? Let's dig together into how this tool works and how you could integrate it into your trading shall we?
What are the data provided by the script, let see one by one:
- Volatility: The value of what vola2vola calls the "synthetic" volatility of the asset is calculated using a custom formula based on the VIXFIX formula. Default colour is blue
- Trade : Trade is generated using an arbitrary and fixed look back period, it acts as a short-term trend. It will give the user the possibility to know if the volatility of the asset is still trending short-term or not. Default colour is black
- Trend: Trend is also generated using an arbitrary and fixed look back period (20 times the one used for Trade), it acts as a longer-term trend. It works the same way as Trade and will give the user the possibility to know if the volatility of the asset is trending a longer-term basis or not. Default colours are: red when the Trend of the volatility of the asset is Bearish and green when the Trend of the volatility of the asset is Bullish
- 52-weeks high & low: Based on the highest and lowest value of Volatility in the past 52 weeks, a 52-weeks high and a 52-weeks low will be marked. These values usually acts as Resistance and Support for volatility. Default colour is black and they are in dotted lines
Here are some of the questions you need to know the answer to before using this script:
- How do you define a "Bullish/Bearish volatility Trade"? Volatility is Bullish Trade is when Volatility is above Trade and it is Bearish Trade when volatility is below Trade
- How do you define a "Bullish/Bearish volatility Trend"? Volatility is Bullish Trend is when Volatility is above Trend and it is Bearish Trend when volatility is below Trend
- On which time frame should i use this script? You want to use the Daily time frame. Although, for short term moves in the volatility space, users could monitor the Hourly timeframe
Understanding the volatility of an asset, along with the bullish or bearish nature of its Trade and Trend, is crucial for investors. Assets with decreasing volatility tend to appreciate in value, while those with increasing volatility tend to depreciate. Therefore, we recommend investors be aware of the volatility situation of the asset they are holding in their portfolio.
Here are the different scenarios that you will encounter on a Daily timeframe and how to interpret them:
- Volatility is below Trade & Trend and Volatility is Bearish Trade and Trend: It is the most Bullish set up for the price of an asset
- Volatility is above Trade & Trend and Volatility is Bullish Trade and Trend: It is the most Bearish set up for the price of an asset
- Any other set up suggests uncertainty, caution is therefore recommended
These are some cases that you could experience while using this script:
1) Bearish Volatility set up on a daily timeframe:
In this example using SPY, when its Volatility is Bearish Trend on a daily timeframe, the price of SPY tends to appreciate
2) Bullish Volatility set up on a daily timeframe:
In this example using SPY, when its Volatility is Bullish Trend on a daily timeframe, the price of SPY tends to depreciate
We hope that you will find these explanations useful, please contact us by private message for access.
Enjoy!
DISCLAIMER: No sharing, copying, reselling, modifying, or any other forms of use are authorised. This script is strictly for individual use and educational purposes only. This is not financial or investment advice. Investments are always made at your own risk and are based on your personal judgement. Myfractalrange is not responsible for any losses you may incur. Please invest wisely.
Goertzel Cycle Composite Wave [Loxx]As the financial markets become increasingly complex and data-driven, traders and analysts must leverage powerful tools to gain insights and make informed decisions. One such tool is the Goertzel Cycle Composite Wave indicator, a sophisticated technical analysis indicator that helps identify cyclical patterns in financial data. This powerful tool is capable of detecting cyclical patterns in financial data, helping traders to make better predictions and optimize their trading strategies. With its unique combination of mathematical algorithms and advanced charting capabilities, this indicator has the potential to revolutionize the way we approach financial modeling and trading.
*** To decrease the load time of this indicator, only XX many bars back will render to the chart. You can control this value with the setting "Number of Bars to Render". This doesn't have anything to do with repainting or the indicator being endpointed***
█ Brief Overview of the Goertzel Cycle Composite Wave
The Goertzel Cycle Composite Wave is a sophisticated technical analysis tool that utilizes the Goertzel algorithm to analyze and visualize cyclical components within a financial time series. By identifying these cycles and their characteristics, the indicator aims to provide valuable insights into the market's underlying price movements, which could potentially be used for making informed trading decisions.
The Goertzel Cycle Composite Wave is considered a non-repainting and endpointed indicator. This means that once a value has been calculated for a specific bar, that value will not change in subsequent bars, and the indicator is designed to have a clear start and end point. This is an important characteristic for indicators used in technical analysis, as it allows traders to make informed decisions based on historical data without the risk of hindsight bias or future changes in the indicator's values. This means traders can use this indicator trading purposes.
The repainting version of this indicator with forecasting, cycle selection/elimination options, and data output table can be found here:
Goertzel Browser
The primary purpose of this indicator is to:
1. Detect and analyze the dominant cycles present in the price data.
2. Reconstruct and visualize the composite wave based on the detected cycles.
To achieve this, the indicator performs several tasks:
1. Detrending the price data: The indicator preprocesses the price data using various detrending techniques, such as Hodrick-Prescott filters, zero-lag moving averages, and linear regression, to remove the underlying trend and focus on the cyclical components.
2. Applying the Goertzel algorithm: The indicator applies the Goertzel algorithm to the detrended price data, identifying the dominant cycles and their characteristics, such as amplitude, phase, and cycle strength.
3. Constructing the composite wave: The indicator reconstructs the composite wave by combining the detected cycles, either by using a user-defined list of cycles or by selecting the top N cycles based on their amplitude or cycle strength.
4. Visualizing the composite wave: The indicator plots the composite wave, using solid lines for the cycles. The color of the lines indicates whether the wave is increasing or decreasing.
This indicator is a powerful tool that employs the Goertzel algorithm to analyze and visualize the cyclical components within a financial time series. By providing insights into the underlying price movements, the indicator aims to assist traders in making more informed decisions.
█ What is the Goertzel Algorithm?
The Goertzel algorithm, named after Gerald Goertzel, is a digital signal processing technique that is used to efficiently compute individual terms of the Discrete Fourier Transform (DFT). It was first introduced in 1958, and since then, it has found various applications in the fields of engineering, mathematics, and physics.
The Goertzel algorithm is primarily used to detect specific frequency components within a digital signal, making it particularly useful in applications where only a few frequency components are of interest. The algorithm is computationally efficient, as it requires fewer calculations than the Fast Fourier Transform (FFT) when detecting a small number of frequency components. This efficiency makes the Goertzel algorithm a popular choice in applications such as:
1. Telecommunications: The Goertzel algorithm is used for decoding Dual-Tone Multi-Frequency (DTMF) signals, which are the tones generated when pressing buttons on a telephone keypad. By identifying specific frequency components, the algorithm can accurately determine which button has been pressed.
2. Audio processing: The algorithm can be used to detect specific pitches or harmonics in an audio signal, making it useful in applications like pitch detection and tuning musical instruments.
3. Vibration analysis: In the field of mechanical engineering, the Goertzel algorithm can be applied to analyze vibrations in rotating machinery, helping to identify faulty components or signs of wear.
4. Power system analysis: The algorithm can be used to measure harmonic content in power systems, allowing engineers to assess power quality and detect potential issues.
The Goertzel algorithm is used in these applications because it offers several advantages over other methods, such as the FFT:
1. Computational efficiency: The Goertzel algorithm requires fewer calculations when detecting a small number of frequency components, making it more computationally efficient than the FFT in these cases.
2. Real-time analysis: The algorithm can be implemented in a streaming fashion, allowing for real-time analysis of signals, which is crucial in applications like telecommunications and audio processing.
3. Memory efficiency: The Goertzel algorithm requires less memory than the FFT, as it only computes the frequency components of interest.
4. Precision: The algorithm is less susceptible to numerical errors compared to the FFT, ensuring more accurate results in applications where precision is essential.
The Goertzel algorithm is an efficient digital signal processing technique that is primarily used to detect specific frequency components within a signal. Its computational efficiency, real-time capabilities, and precision make it an attractive choice for various applications, including telecommunications, audio processing, vibration analysis, and power system analysis. The algorithm has been widely adopted since its introduction in 1958 and continues to be an essential tool in the fields of engineering, mathematics, and physics.
█ Goertzel Algorithm in Quantitative Finance: In-Depth Analysis and Applications
The Goertzel algorithm, initially designed for signal processing in telecommunications, has gained significant traction in the financial industry due to its efficient frequency detection capabilities. In quantitative finance, the Goertzel algorithm has been utilized for uncovering hidden market cycles, developing data-driven trading strategies, and optimizing risk management. This section delves deeper into the applications of the Goertzel algorithm in finance, particularly within the context of quantitative trading and analysis.
Unveiling Hidden Market Cycles:
Market cycles are prevalent in financial markets and arise from various factors, such as economic conditions, investor psychology, and market participant behavior. The Goertzel algorithm's ability to detect and isolate specific frequencies in price data helps trader analysts identify hidden market cycles that may otherwise go unnoticed. By examining the amplitude, phase, and periodicity of each cycle, traders can better understand the underlying market structure and dynamics, enabling them to develop more informed and effective trading strategies.
Developing Quantitative Trading Strategies:
The Goertzel algorithm's versatility allows traders to incorporate its insights into a wide range of trading strategies. By identifying the dominant market cycles in a financial instrument's price data, traders can create data-driven strategies that capitalize on the cyclical nature of markets.
For instance, a trader may develop a mean-reversion strategy that takes advantage of the identified cycles. By establishing positions when the price deviates from the predicted cycle, the trader can profit from the subsequent reversion to the cycle's mean. Similarly, a momentum-based strategy could be designed to exploit the persistence of a dominant cycle by entering positions that align with the cycle's direction.
Enhancing Risk Management:
The Goertzel algorithm plays a vital role in risk management for quantitative strategies. By analyzing the cyclical components of a financial instrument's price data, traders can gain insights into the potential risks associated with their trading strategies.
By monitoring the amplitude and phase of dominant cycles, a trader can detect changes in market dynamics that may pose risks to their positions. For example, a sudden increase in amplitude may indicate heightened volatility, prompting the trader to adjust position sizing or employ hedging techniques to protect their portfolio. Additionally, changes in phase alignment could signal a potential shift in market sentiment, necessitating adjustments to the trading strategy.
Expanding Quantitative Toolkits:
Traders can augment the Goertzel algorithm's insights by combining it with other quantitative techniques, creating a more comprehensive and sophisticated analysis framework. For example, machine learning algorithms, such as neural networks or support vector machines, could be trained on features extracted from the Goertzel algorithm to predict future price movements more accurately.
Furthermore, the Goertzel algorithm can be integrated with other technical analysis tools, such as moving averages or oscillators, to enhance their effectiveness. By applying these tools to the identified cycles, traders can generate more robust and reliable trading signals.
The Goertzel algorithm offers invaluable benefits to quantitative finance practitioners by uncovering hidden market cycles, aiding in the development of data-driven trading strategies, and improving risk management. By leveraging the insights provided by the Goertzel algorithm and integrating it with other quantitative techniques, traders can gain a deeper understanding of market dynamics and devise more effective trading strategies.
█ Indicator Inputs
src: This is the source data for the analysis, typically the closing price of the financial instrument.
detrendornot: This input determines the method used for detrending the source data. Detrending is the process of removing the underlying trend from the data to focus on the cyclical components.
The available options are:
hpsmthdt: Detrend using Hodrick-Prescott filter centered moving average.
zlagsmthdt: Detrend using zero-lag moving average centered moving average.
logZlagRegression: Detrend using logarithmic zero-lag linear regression.
hpsmth: Detrend using Hodrick-Prescott filter.
zlagsmth: Detrend using zero-lag moving average.
DT_HPper1 and DT_HPper2: These inputs define the period range for the Hodrick-Prescott filter centered moving average when detrendornot is set to hpsmthdt.
DT_ZLper1 and DT_ZLper2: These inputs define the period range for the zero-lag moving average centered moving average when detrendornot is set to zlagsmthdt.
DT_RegZLsmoothPer: This input defines the period for the zero-lag moving average used in logarithmic zero-lag linear regression when detrendornot is set to logZlagRegression.
HPsmoothPer: This input defines the period for the Hodrick-Prescott filter when detrendornot is set to hpsmth.
ZLMAsmoothPer: This input defines the period for the zero-lag moving average when detrendornot is set to zlagsmth.
MaxPer: This input sets the maximum period for the Goertzel algorithm to search for cycles.
squaredAmp: This boolean input determines whether the amplitude should be squared in the Goertzel algorithm.
useAddition: This boolean input determines whether the Goertzel algorithm should use addition for combining the cycles.
useCosine: This boolean input determines whether the Goertzel algorithm should use cosine waves instead of sine waves.
UseCycleStrength: This boolean input determines whether the Goertzel algorithm should compute the cycle strength, which is a normalized measure of the cycle's amplitude.
WindowSizePast: These inputs define the window size for the composite wave.
FilterBartels: This boolean input determines whether Bartel's test should be applied to filter out non-significant cycles.
BartNoCycles: This input sets the number of cycles to be used in Bartel's test.
BartSmoothPer: This input sets the period for the moving average used in Bartel's test.
BartSigLimit: This input sets the significance limit for Bartel's test, below which cycles are considered insignificant.
SortBartels: This boolean input determines whether the cycles should be sorted by their Bartel's test results.
StartAtCycle: This input determines the starting index for selecting the top N cycles when UseCycleList is set to false. This allows you to skip a certain number of cycles from the top before selecting the desired number of cycles.
UseTopCycles: This input sets the number of top cycles to use for constructing the composite wave when UseCycleList is set to false. The cycles are ranked based on their amplitudes or cycle strengths, depending on the UseCycleStrength input.
SubtractNoise: This boolean input determines whether to subtract the noise (remaining cycles) from the composite wave. If set to true, the composite wave will only include the top N cycles specified by UseTopCycles.
█ Exploring Auxiliary Functions
The following functions demonstrate advanced techniques for analyzing financial markets, including zero-lag moving averages, Bartels probability, detrending, and Hodrick-Prescott filtering. This section examines each function in detail, explaining their purpose, methodology, and applications in finance. We will examine how each function contributes to the overall performance and effectiveness of the indicator and how they work together to create a powerful analytical tool.
Zero-Lag Moving Average:
The zero-lag moving average function is designed to minimize the lag typically associated with moving averages. This is achieved through a two-step weighted linear regression process that emphasizes more recent data points. The function calculates a linearly weighted moving average (LWMA) on the input data and then applies another LWMA on the result. By doing this, the function creates a moving average that closely follows the price action, reducing the lag and improving the responsiveness of the indicator.
The zero-lag moving average function is used in the indicator to provide a responsive, low-lag smoothing of the input data. This function helps reduce the noise and fluctuations in the data, making it easier to identify and analyze underlying trends and patterns. By minimizing the lag associated with traditional moving averages, this function allows the indicator to react more quickly to changes in market conditions, providing timely signals and improving the overall effectiveness of the indicator.
Bartels Probability:
The Bartels probability function calculates the probability of a given cycle being significant in a time series. It uses a mathematical test called the Bartels test to assess the significance of cycles detected in the data. The function calculates coefficients for each detected cycle and computes an average amplitude and an expected amplitude. By comparing these values, the Bartels probability is derived, indicating the likelihood of a cycle's significance. This information can help in identifying and analyzing dominant cycles in financial markets.
The Bartels probability function is incorporated into the indicator to assess the significance of detected cycles in the input data. By calculating the Bartels probability for each cycle, the indicator can prioritize the most significant cycles and focus on the market dynamics that are most relevant to the current trading environment. This function enhances the indicator's ability to identify dominant market cycles, improving its predictive power and aiding in the development of effective trading strategies.
Detrend Logarithmic Zero-Lag Regression:
The detrend logarithmic zero-lag regression function is used for detrending data while minimizing lag. It combines a zero-lag moving average with a linear regression detrending method. The function first calculates the zero-lag moving average of the logarithm of input data and then applies a linear regression to remove the trend. By detrending the data, the function isolates the cyclical components, making it easier to analyze and interpret the underlying market dynamics.
The detrend logarithmic zero-lag regression function is used in the indicator to isolate the cyclical components of the input data. By detrending the data, the function enables the indicator to focus on the cyclical movements in the market, making it easier to analyze and interpret market dynamics. This function is essential for identifying cyclical patterns and understanding the interactions between different market cycles, which can inform trading decisions and enhance overall market understanding.
Bartels Cycle Significance Test:
The Bartels cycle significance test is a function that combines the Bartels probability function and the detrend logarithmic zero-lag regression function to assess the significance of detected cycles. The function calculates the Bartels probability for each cycle and stores the results in an array. By analyzing the probability values, traders and analysts can identify the most significant cycles in the data, which can be used to develop trading strategies and improve market understanding.
The Bartels cycle significance test function is integrated into the indicator to provide a comprehensive analysis of the significance of detected cycles. By combining the Bartels probability function and the detrend logarithmic zero-lag regression function, this test evaluates the significance of each cycle and stores the results in an array. The indicator can then use this information to prioritize the most significant cycles and focus on the most relevant market dynamics. This function enhances the indicator's ability to identify and analyze dominant market cycles, providing valuable insights for trading and market analysis.
Hodrick-Prescott Filter:
The Hodrick-Prescott filter is a popular technique used to separate the trend and cyclical components of a time series. The function applies a smoothing parameter to the input data and calculates a smoothed series using a two-sided filter. This smoothed series represents the trend component, which can be subtracted from the original data to obtain the cyclical component. The Hodrick-Prescott filter is commonly used in economics and finance to analyze economic data and financial market trends.
The Hodrick-Prescott filter is incorporated into the indicator to separate the trend and cyclical components of the input data. By applying the filter to the data, the indicator can isolate the trend component, which can be used to analyze long-term market trends and inform trading decisions. Additionally, the cyclical component can be used to identify shorter-term market dynamics and provide insights into potential trading opportunities. The inclusion of the Hodrick-Prescott filter adds another layer of analysis to the indicator, making it more versatile and comprehensive.
Detrending Options: Detrend Centered Moving Average:
The detrend centered moving average function provides different detrending methods, including the Hodrick-Prescott filter and the zero-lag moving average, based on the selected detrending method. The function calculates two sets of smoothed values using the chosen method and subtracts one set from the other to obtain a detrended series. By offering multiple detrending options, this function allows traders and analysts to select the most appropriate method for their specific needs and preferences.
The detrend centered moving average function is integrated into the indicator to provide users with multiple detrending options, including the Hodrick-Prescott filter and the zero-lag moving average. By offering multiple detrending methods, the indicator allows users to customize the analysis to their specific needs and preferences, enhancing the indicator's overall utility and adaptability. This function ensures that the indicator can cater to a wide range of trading styles and objectives, making it a valuable tool for a diverse group of market participants.
The auxiliary functions functions discussed in this section demonstrate the power and versatility of mathematical techniques in analyzing financial markets. By understanding and implementing these functions, traders and analysts can gain valuable insights into market dynamics, improve their trading strategies, and make more informed decisions. The combination of zero-lag moving averages, Bartels probability, detrending methods, and the Hodrick-Prescott filter provides a comprehensive toolkit for analyzing and interpreting financial data. The integration of advanced functions in a financial indicator creates a powerful and versatile analytical tool that can provide valuable insights into financial markets. By combining the zero-lag moving average,
█ In-Depth Analysis of the Goertzel Cycle Composite Wave Code
The Goertzel Cycle Composite Wave code is an implementation of the Goertzel Algorithm, an efficient technique to perform spectral analysis on a signal. The code is designed to detect and analyze dominant cycles within a given financial market data set. This section will provide an extremely detailed explanation of the code, its structure, functions, and intended purpose.
Function signature and input parameters:
The Goertzel Cycle Composite Wave function accepts numerous input parameters for customization, including source data (src), the current bar (forBar), sample size (samplesize), period (per), squared amplitude flag (squaredAmp), addition flag (useAddition), cosine flag (useCosine), cycle strength flag (UseCycleStrength), past sizes (WindowSizePast), Bartels filter flag (FilterBartels), Bartels-related parameters (BartNoCycles, BartSmoothPer, BartSigLimit), sorting flag (SortBartels), and output buffers (goeWorkPast, cyclebuffer, amplitudebuffer, phasebuffer, cycleBartelsBuffer).
Initializing variables and arrays:
The code initializes several float arrays (goeWork1, goeWork2, goeWork3, goeWork4) with the same length as twice the period (2 * per). These arrays store intermediate results during the execution of the algorithm.
Preprocessing input data:
The input data (src) undergoes preprocessing to remove linear trends. This step enhances the algorithm's ability to focus on cyclical components in the data. The linear trend is calculated by finding the slope between the first and last values of the input data within the sample.
Iterative calculation of Goertzel coefficients:
The core of the Goertzel Cycle Composite Wave algorithm lies in the iterative calculation of Goertzel coefficients for each frequency bin. These coefficients represent the spectral content of the input data at different frequencies. The code iterates through the range of frequencies, calculating the Goertzel coefficients using a nested loop structure.
Cycle strength computation:
The code calculates the cycle strength based on the Goertzel coefficients. This is an optional step, controlled by the UseCycleStrength flag. The cycle strength provides information on the relative influence of each cycle on the data per bar, considering both amplitude and cycle length. The algorithm computes the cycle strength either by squaring the amplitude (controlled by squaredAmp flag) or using the actual amplitude values.
Phase calculation:
The Goertzel Cycle Composite Wave code computes the phase of each cycle, which represents the position of the cycle within the input data. The phase is calculated using the arctangent function (math.atan) based on the ratio of the imaginary and real components of the Goertzel coefficients.
Peak detection and cycle extraction:
The algorithm performs peak detection on the computed amplitudes or cycle strengths to identify dominant cycles. It stores the detected cycles in the cyclebuffer array, along with their corresponding amplitudes and phases in the amplitudebuffer and phasebuffer arrays, respectively.
Sorting cycles by amplitude or cycle strength:
The code sorts the detected cycles based on their amplitude or cycle strength in descending order. This allows the algorithm to prioritize cycles with the most significant impact on the input data.
Bartels cycle significance test:
If the FilterBartels flag is set, the code performs a Bartels cycle significance test on the detected cycles. This test determines the statistical significance of each cycle and filters out the insignificant cycles. The significant cycles are stored in the cycleBartelsBuffer array. If the SortBartels flag is set, the code sorts the significant cycles based on their Bartels significance values.
Waveform calculation:
The Goertzel Cycle Composite Wave code calculates the waveform of the significant cycles for specified time windows. The windows are defined by the WindowSizePast parameters, respectively. The algorithm uses either cosine or sine functions (controlled by the useCosine flag) to calculate the waveforms for each cycle. The useAddition flag determines whether the waveforms should be added or subtracted.
Storing waveforms in a matrix:
The calculated waveforms for the cycle is stored in the matrix - goeWorkPast. This matrix holds the waveforms for the specified time windows. Each row in the matrix represents a time window position, and each column corresponds to a cycle.
Returning the number of cycles:
The Goertzel Cycle Composite Wave function returns the total number of detected cycles (number_of_cycles) after processing the input data. This information can be used to further analyze the results or to visualize the detected cycles.
The Goertzel Cycle Composite Wave code is a comprehensive implementation of the Goertzel Algorithm, specifically designed for detecting and analyzing dominant cycles within financial market data. The code offers a high level of customization, allowing users to fine-tune the algorithm based on their specific needs. The Goertzel Cycle Composite Wave's combination of preprocessing, iterative calculations, cycle extraction, sorting, significance testing, and waveform calculation makes it a powerful tool for understanding cyclical components in financial data.
█ Generating and Visualizing Composite Waveform
The indicator calculates and visualizes the composite waveform for specified time windows based on the detected cycles. Here's a detailed explanation of this process:
Updating WindowSizePast:
The WindowSizePast is updated to ensure they are at least twice the MaxPer (maximum period).
Initializing matrices and arrays:
The matrix goeWorkPast is initialized to store the Goertzel results for specified time windows. Multiple arrays are also initialized to store cycle, amplitude, phase, and Bartels information.
Preparing the source data (srcVal) array:
The source data is copied into an array, srcVal, and detrended using one of the selected methods (hpsmthdt, zlagsmthdt, logZlagRegression, hpsmth, or zlagsmth).
Goertzel function call:
The Goertzel function is called to analyze the detrended source data and extract cycle information. The output, number_of_cycles, contains the number of detected cycles.
Initializing arrays for waveforms:
The goertzel array is initialized to store the endpoint Goertzel.
Calculating composite waveform (goertzel array):
The composite waveform is calculated by summing the selected cycles (either from the user-defined cycle list or the top cycles) and optionally subtracting the noise component.
Drawing composite waveform (pvlines):
The composite waveform is drawn on the chart using solid lines. The color of the lines is determined by the direction of the waveform (green for upward, red for downward).
To summarize, this indicator generates a composite waveform based on the detected cycles in the financial data. It calculates the composite waveforms and visualizes them on the chart using colored lines.
█ Enhancing the Goertzel Algorithm-Based Script for Financial Modeling and Trading
The Goertzel algorithm-based script for detecting dominant cycles in financial data is a powerful tool for financial modeling and trading. It provides valuable insights into the past behavior of these cycles. However, as with any algorithm, there is always room for improvement. This section discusses potential enhancements to the existing script to make it even more robust and versatile for financial modeling, general trading, advanced trading, and high-frequency finance trading.
Enhancements for Financial Modeling
Data preprocessing: One way to improve the script's performance for financial modeling is to introduce more advanced data preprocessing techniques. This could include removing outliers, handling missing data, and normalizing the data to ensure consistent and accurate results.
Additional detrending and smoothing methods: Incorporating more sophisticated detrending and smoothing techniques, such as wavelet transform or empirical mode decomposition, can help improve the script's ability to accurately identify cycles and trends in the data.
Machine learning integration: Integrating machine learning techniques, such as artificial neural networks or support vector machines, can help enhance the script's predictive capabilities, leading to more accurate financial models.
Enhancements for General and Advanced Trading
Customizable indicator integration: Allowing users to integrate their own technical indicators can help improve the script's effectiveness for both general and advanced trading. By enabling the combination of the dominant cycle information with other technical analysis tools, traders can develop more comprehensive trading strategies.
Risk management and position sizing: Incorporating risk management and position sizing functionality into the script can help traders better manage their trades and control potential losses. This can be achieved by calculating the optimal position size based on the user's risk tolerance and account size.
Multi-timeframe analysis: Enhancing the script to perform multi-timeframe analysis can provide traders with a more holistic view of market trends and cycles. By identifying dominant cycles on different timeframes, traders can gain insights into the potential confluence of cycles and make better-informed trading decisions.
Enhancements for High-Frequency Finance Trading
Algorithm optimization: To ensure the script's suitability for high-frequency finance trading, optimizing the algorithm for faster execution is crucial. This can be achieved by employing efficient data structures and refining the calculation methods to minimize computational complexity.
Real-time data streaming: Integrating real-time data streaming capabilities into the script can help high-frequency traders react to market changes more quickly. By continuously updating the cycle information based on real-time market data, traders can adapt their strategies accordingly and capitalize on short-term market fluctuations.
Order execution and trade management: To fully leverage the script's capabilities for high-frequency trading, implementing functionality for automated order execution and trade management is essential. This can include features such as stop-loss and take-profit orders, trailing stops, and automated trade exit strategies.
While the existing Goertzel algorithm-based script is a valuable tool for detecting dominant cycles in financial data, there are several potential enhancements that can make it even more powerful for financial modeling, general trading, advanced trading, and high-frequency finance trading. By incorporating these improvements, the script can become a more versatile and effective tool for traders and financial analysts alike.
█ Understanding the Limitations of the Goertzel Algorithm
While the Goertzel algorithm-based script for detecting dominant cycles in financial data provides valuable insights, it is important to be aware of its limitations and drawbacks. Some of the key drawbacks of this indicator are:
Lagging nature:
As with many other technical indicators, the Goertzel algorithm-based script can suffer from lagging effects, meaning that it may not immediately react to real-time market changes. This lag can lead to late entries and exits, potentially resulting in reduced profitability or increased losses.
Parameter sensitivity:
The performance of the script can be sensitive to the chosen parameters, such as the detrending methods, smoothing techniques, and cycle detection settings. Improper parameter selection may lead to inaccurate cycle detection or increased false signals, which can negatively impact trading performance.
Complexity:
The Goertzel algorithm itself is relatively complex, making it difficult for novice traders or those unfamiliar with the concept of cycle analysis to fully understand and effectively utilize the script. This complexity can also make it challenging to optimize the script for specific trading styles or market conditions.
Overfitting risk:
As with any data-driven approach, there is a risk of overfitting when using the Goertzel algorithm-based script. Overfitting occurs when a model becomes too specific to the historical data it was trained on, leading to poor performance on new, unseen data. This can result in misleading signals and reduced trading performance.
Limited applicability:
The Goertzel algorithm-based script may not be suitable for all markets, trading styles, or timeframes. Its effectiveness in detecting cycles may be limited in certain market conditions, such as during periods of extreme volatility or low liquidity.
While the Goertzel algorithm-based script offers valuable insights into dominant cycles in financial data, it is essential to consider its drawbacks and limitations when incorporating it into a trading strategy. Traders should always use the script in conjunction with other technical and fundamental analysis tools, as well as proper risk management, to make well-informed trading decisions.
█ Interpreting Results
The Goertzel Cycle Composite Wave indicator can be interpreted by analyzing the plotted lines. The indicator plots two lines: composite waves. The composite wave represents the composite wave of the price data.
The composite wave line displays a solid line, with green indicating a bullish trend and red indicating a bearish trend.
Interpreting the Goertzel Cycle Composite Wave indicator involves identifying the trend of the composite wave lines and matching them with the corresponding bullish or bearish color.
█ Conclusion
The Goertzel Cycle Composite Wave indicator is a powerful tool for identifying and analyzing cyclical patterns in financial markets. Its ability to detect multiple cycles of varying frequencies and strengths make it a valuable addition to any trader's technical analysis toolkit. However, it is important to keep in mind that the Goertzel Cycle Composite Wave indicator should be used in conjunction with other technical analysis tools and fundamental analysis to achieve the best results. With continued refinement and development, the Goertzel Cycle Composite Wave indicator has the potential to become a highly effective tool for financial modeling, general trading, advanced trading, and high-frequency finance trading. Its accuracy and versatility make it a promising candidate for further research and development.
█ Footnotes
What is the Bartels Test for Cycle Significance?
The Bartels Cycle Significance Test is a statistical method that determines whether the peaks and troughs of a time series are statistically significant. The test is named after its inventor, George Bartels, who developed it in the mid-20th century.
The Bartels test is designed to analyze the cyclical components of a time series, which can help traders and analysts identify trends and cycles in financial markets. The test calculates a Bartels statistic, which measures the degree of non-randomness or autocorrelation in the time series.
The Bartels statistic is calculated by first splitting the time series into two halves and calculating the range of the peaks and troughs in each half. The test then compares these ranges using a t-test, which measures the significance of the difference between the two ranges.
If the Bartels statistic is greater than a critical value, it indicates that the peaks and troughs in the time series are non-random and that there is a significant cyclical component to the data. Conversely, if the Bartels statistic is less than the critical value, it suggests that the peaks and troughs are random and that there is no significant cyclical component.
The Bartels Cycle Significance Test is particularly useful in financial analysis because it can help traders and analysts identify significant cycles in asset prices, which can in turn inform investment decisions. However, it is important to note that the test is not perfect and can produce false signals in certain situations, particularly in noisy or volatile markets. Therefore, it is always recommended to use the test in conjunction with other technical and fundamental indicators to confirm trends and cycles.
Deep-dive into the Hodrick-Prescott Fitler
The Hodrick-Prescott (HP) filter is a statistical tool used in economics and finance to separate a time series into two components: a trend component and a cyclical component. It is a powerful tool for identifying long-term trends in economic and financial data and is widely used by economists, central banks, and financial institutions around the world.
The HP filter was first introduced in the 1990s by economists Robert Hodrick and Edward Prescott. It is a simple, two-parameter filter that separates a time series into a trend component and a cyclical component. The trend component represents the long-term behavior of the data, while the cyclical component captures the shorter-term fluctuations around the trend.
The HP filter works by minimizing the following objective function:
Minimize: (Sum of Squared Deviations) + λ (Sum of Squared Second Differences)
Where:
1. The first term represents the deviation of the data from the trend.
2. The second term represents the smoothness of the trend.
3. λ is a smoothing parameter that determines the degree of smoothness of the trend.
The smoothing parameter λ is typically set to a value between 100 and 1600, depending on the frequency of the data. Higher values of λ lead to a smoother trend, while lower values lead to a more volatile trend.
The HP filter has several advantages over other smoothing techniques. It is a non-parametric method, meaning that it does not make any assumptions about the underlying distribution of the data. It also allows for easy comparison of trends across different time series and can be used with data of any frequency.
However, the HP filter also has some limitations. It assumes that the trend is a smooth function, which may not be the case in some situations. It can also be sensitive to changes in the smoothing parameter λ, which may result in different trends for the same data. Additionally, the filter may produce unrealistic trends for very short time series.
Despite these limitations, the HP filter remains a valuable tool for analyzing economic and financial data. It is widely used by central banks and financial institutions to monitor long-term trends in the economy, and it can be used to identify turning points in the business cycle. The filter can also be used to analyze asset prices, exchange rates, and other financial variables.
The Hodrick-Prescott filter is a powerful tool for analyzing economic and financial data. It separates a time series into a trend component and a cyclical component, allowing for easy identification of long-term trends and turning points in the business cycle. While it has some limitations, it remains a valuable tool for economists, central banks, and financial institutions around the world.
Goertzel Browser [Loxx]As the financial markets become increasingly complex and data-driven, traders and analysts must leverage powerful tools to gain insights and make informed decisions. One such tool is the Goertzel Browser indicator, a sophisticated technical analysis indicator that helps identify cyclical patterns in financial data. This powerful tool is capable of detecting cyclical patterns in financial data, helping traders to make better predictions and optimize their trading strategies. With its unique combination of mathematical algorithms and advanced charting capabilities, this indicator has the potential to revolutionize the way we approach financial modeling and trading.
█ Brief Overview of the Goertzel Browser
The Goertzel Browser is a sophisticated technical analysis tool that utilizes the Goertzel algorithm to analyze and visualize cyclical components within a financial time series. By identifying these cycles and their characteristics, the indicator aims to provide valuable insights into the market's underlying price movements, which could potentially be used for making informed trading decisions.
The primary purpose of this indicator is to:
1. Detect and analyze the dominant cycles present in the price data.
2. Reconstruct and visualize the composite wave based on the detected cycles.
3. Project the composite wave into the future, providing a potential roadmap for upcoming price movements.
To achieve this, the indicator performs several tasks:
1. Detrending the price data: The indicator preprocesses the price data using various detrending techniques, such as Hodrick-Prescott filters, zero-lag moving averages, and linear regression, to remove the underlying trend and focus on the cyclical components.
2. Applying the Goertzel algorithm: The indicator applies the Goertzel algorithm to the detrended price data, identifying the dominant cycles and their characteristics, such as amplitude, phase, and cycle strength.
3. Constructing the composite wave: The indicator reconstructs the composite wave by combining the detected cycles, either by using a user-defined list of cycles or by selecting the top N cycles based on their amplitude or cycle strength.
4. Visualizing the composite wave: The indicator plots the composite wave, using solid lines for the past and dotted lines for the future projections. The color of the lines indicates whether the wave is increasing or decreasing.
5. Displaying cycle information: The indicator provides a table that displays detailed information about the detected cycles, including their rank, period, Bartel's test results, amplitude, and phase.
This indicator is a powerful tool that employs the Goertzel algorithm to analyze and visualize the cyclical components within a financial time series. By providing insights into the underlying price movements and their potential future trajectory, the indicator aims to assist traders in making more informed decisions.
█ What is the Goertzel Algorithm?
The Goertzel algorithm, named after Gerald Goertzel, is a digital signal processing technique that is used to efficiently compute individual terms of the Discrete Fourier Transform (DFT). It was first introduced in 1958, and since then, it has found various applications in the fields of engineering, mathematics, and physics.
The Goertzel algorithm is primarily used to detect specific frequency components within a digital signal, making it particularly useful in applications where only a few frequency components are of interest. The algorithm is computationally efficient, as it requires fewer calculations than the Fast Fourier Transform (FFT) when detecting a small number of frequency components. This efficiency makes the Goertzel algorithm a popular choice in applications such as:
1. Telecommunications: The Goertzel algorithm is used for decoding Dual-Tone Multi-Frequency (DTMF) signals, which are the tones generated when pressing buttons on a telephone keypad. By identifying specific frequency components, the algorithm can accurately determine which button has been pressed.
2. Audio processing: The algorithm can be used to detect specific pitches or harmonics in an audio signal, making it useful in applications like pitch detection and tuning musical instruments.
3. Vibration analysis: In the field of mechanical engineering, the Goertzel algorithm can be applied to analyze vibrations in rotating machinery, helping to identify faulty components or signs of wear.
4. Power system analysis: The algorithm can be used to measure harmonic content in power systems, allowing engineers to assess power quality and detect potential issues.
The Goertzel algorithm is used in these applications because it offers several advantages over other methods, such as the FFT:
1. Computational efficiency: The Goertzel algorithm requires fewer calculations when detecting a small number of frequency components, making it more computationally efficient than the FFT in these cases.
2. Real-time analysis: The algorithm can be implemented in a streaming fashion, allowing for real-time analysis of signals, which is crucial in applications like telecommunications and audio processing.
3. Memory efficiency: The Goertzel algorithm requires less memory than the FFT, as it only computes the frequency components of interest.
4. Precision: The algorithm is less susceptible to numerical errors compared to the FFT, ensuring more accurate results in applications where precision is essential.
The Goertzel algorithm is an efficient digital signal processing technique that is primarily used to detect specific frequency components within a signal. Its computational efficiency, real-time capabilities, and precision make it an attractive choice for various applications, including telecommunications, audio processing, vibration analysis, and power system analysis. The algorithm has been widely adopted since its introduction in 1958 and continues to be an essential tool in the fields of engineering, mathematics, and physics.
█ Goertzel Algorithm in Quantitative Finance: In-Depth Analysis and Applications
The Goertzel algorithm, initially designed for signal processing in telecommunications, has gained significant traction in the financial industry due to its efficient frequency detection capabilities. In quantitative finance, the Goertzel algorithm has been utilized for uncovering hidden market cycles, developing data-driven trading strategies, and optimizing risk management. This section delves deeper into the applications of the Goertzel algorithm in finance, particularly within the context of quantitative trading and analysis.
Unveiling Hidden Market Cycles:
Market cycles are prevalent in financial markets and arise from various factors, such as economic conditions, investor psychology, and market participant behavior. The Goertzel algorithm's ability to detect and isolate specific frequencies in price data helps trader analysts identify hidden market cycles that may otherwise go unnoticed. By examining the amplitude, phase, and periodicity of each cycle, traders can better understand the underlying market structure and dynamics, enabling them to develop more informed and effective trading strategies.
Developing Quantitative Trading Strategies:
The Goertzel algorithm's versatility allows traders to incorporate its insights into a wide range of trading strategies. By identifying the dominant market cycles in a financial instrument's price data, traders can create data-driven strategies that capitalize on the cyclical nature of markets.
For instance, a trader may develop a mean-reversion strategy that takes advantage of the identified cycles. By establishing positions when the price deviates from the predicted cycle, the trader can profit from the subsequent reversion to the cycle's mean. Similarly, a momentum-based strategy could be designed to exploit the persistence of a dominant cycle by entering positions that align with the cycle's direction.
Enhancing Risk Management:
The Goertzel algorithm plays a vital role in risk management for quantitative strategies. By analyzing the cyclical components of a financial instrument's price data, traders can gain insights into the potential risks associated with their trading strategies.
By monitoring the amplitude and phase of dominant cycles, a trader can detect changes in market dynamics that may pose risks to their positions. For example, a sudden increase in amplitude may indicate heightened volatility, prompting the trader to adjust position sizing or employ hedging techniques to protect their portfolio. Additionally, changes in phase alignment could signal a potential shift in market sentiment, necessitating adjustments to the trading strategy.
Expanding Quantitative Toolkits:
Traders can augment the Goertzel algorithm's insights by combining it with other quantitative techniques, creating a more comprehensive and sophisticated analysis framework. For example, machine learning algorithms, such as neural networks or support vector machines, could be trained on features extracted from the Goertzel algorithm to predict future price movements more accurately.
Furthermore, the Goertzel algorithm can be integrated with other technical analysis tools, such as moving averages or oscillators, to enhance their effectiveness. By applying these tools to the identified cycles, traders can generate more robust and reliable trading signals.
The Goertzel algorithm offers invaluable benefits to quantitative finance practitioners by uncovering hidden market cycles, aiding in the development of data-driven trading strategies, and improving risk management. By leveraging the insights provided by the Goertzel algorithm and integrating it with other quantitative techniques, traders can gain a deeper understanding of market dynamics and devise more effective trading strategies.
█ Indicator Inputs
src: This is the source data for the analysis, typically the closing price of the financial instrument.
detrendornot: This input determines the method used for detrending the source data. Detrending is the process of removing the underlying trend from the data to focus on the cyclical components.
The available options are:
hpsmthdt: Detrend using Hodrick-Prescott filter centered moving average.
zlagsmthdt: Detrend using zero-lag moving average centered moving average.
logZlagRegression: Detrend using logarithmic zero-lag linear regression.
hpsmth: Detrend using Hodrick-Prescott filter.
zlagsmth: Detrend using zero-lag moving average.
DT_HPper1 and DT_HPper2: These inputs define the period range for the Hodrick-Prescott filter centered moving average when detrendornot is set to hpsmthdt.
DT_ZLper1 and DT_ZLper2: These inputs define the period range for the zero-lag moving average centered moving average when detrendornot is set to zlagsmthdt.
DT_RegZLsmoothPer: This input defines the period for the zero-lag moving average used in logarithmic zero-lag linear regression when detrendornot is set to logZlagRegression.
HPsmoothPer: This input defines the period for the Hodrick-Prescott filter when detrendornot is set to hpsmth.
ZLMAsmoothPer: This input defines the period for the zero-lag moving average when detrendornot is set to zlagsmth.
MaxPer: This input sets the maximum period for the Goertzel algorithm to search for cycles.
squaredAmp: This boolean input determines whether the amplitude should be squared in the Goertzel algorithm.
useAddition: This boolean input determines whether the Goertzel algorithm should use addition for combining the cycles.
useCosine: This boolean input determines whether the Goertzel algorithm should use cosine waves instead of sine waves.
UseCycleStrength: This boolean input determines whether the Goertzel algorithm should compute the cycle strength, which is a normalized measure of the cycle's amplitude.
WindowSizePast and WindowSizeFuture: These inputs define the window size for past and future projections of the composite wave.
FilterBartels: This boolean input determines whether Bartel's test should be applied to filter out non-significant cycles.
BartNoCycles: This input sets the number of cycles to be used in Bartel's test.
BartSmoothPer: This input sets the period for the moving average used in Bartel's test.
BartSigLimit: This input sets the significance limit for Bartel's test, below which cycles are considered insignificant.
SortBartels: This boolean input determines whether the cycles should be sorted by their Bartel's test results.
UseCycleList: This boolean input determines whether a user-defined list of cycles should be used for constructing the composite wave. If set to false, the top N cycles will be used.
Cycle1, Cycle2, Cycle3, Cycle4, and Cycle5: These inputs define the user-defined list of cycles when 'UseCycleList' is set to true. If using a user-defined list, each of these inputs represents the period of a specific cycle to include in the composite wave.
StartAtCycle: This input determines the starting index for selecting the top N cycles when UseCycleList is set to false. This allows you to skip a certain number of cycles from the top before selecting the desired number of cycles.
UseTopCycles: This input sets the number of top cycles to use for constructing the composite wave when UseCycleList is set to false. The cycles are ranked based on their amplitudes or cycle strengths, depending on the UseCycleStrength input.
SubtractNoise: This boolean input determines whether to subtract the noise (remaining cycles) from the composite wave. If set to true, the composite wave will only include the top N cycles specified by UseTopCycles.
█ Exploring Auxiliary Functions
The following functions demonstrate advanced techniques for analyzing financial markets, including zero-lag moving averages, Bartels probability, detrending, and Hodrick-Prescott filtering. This section examines each function in detail, explaining their purpose, methodology, and applications in finance. We will examine how each function contributes to the overall performance and effectiveness of the indicator and how they work together to create a powerful analytical tool.
Zero-Lag Moving Average:
The zero-lag moving average function is designed to minimize the lag typically associated with moving averages. This is achieved through a two-step weighted linear regression process that emphasizes more recent data points. The function calculates a linearly weighted moving average (LWMA) on the input data and then applies another LWMA on the result. By doing this, the function creates a moving average that closely follows the price action, reducing the lag and improving the responsiveness of the indicator.
The zero-lag moving average function is used in the indicator to provide a responsive, low-lag smoothing of the input data. This function helps reduce the noise and fluctuations in the data, making it easier to identify and analyze underlying trends and patterns. By minimizing the lag associated with traditional moving averages, this function allows the indicator to react more quickly to changes in market conditions, providing timely signals and improving the overall effectiveness of the indicator.
Bartels Probability:
The Bartels probability function calculates the probability of a given cycle being significant in a time series. It uses a mathematical test called the Bartels test to assess the significance of cycles detected in the data. The function calculates coefficients for each detected cycle and computes an average amplitude and an expected amplitude. By comparing these values, the Bartels probability is derived, indicating the likelihood of a cycle's significance. This information can help in identifying and analyzing dominant cycles in financial markets.
The Bartels probability function is incorporated into the indicator to assess the significance of detected cycles in the input data. By calculating the Bartels probability for each cycle, the indicator can prioritize the most significant cycles and focus on the market dynamics that are most relevant to the current trading environment. This function enhances the indicator's ability to identify dominant market cycles, improving its predictive power and aiding in the development of effective trading strategies.
Detrend Logarithmic Zero-Lag Regression:
The detrend logarithmic zero-lag regression function is used for detrending data while minimizing lag. It combines a zero-lag moving average with a linear regression detrending method. The function first calculates the zero-lag moving average of the logarithm of input data and then applies a linear regression to remove the trend. By detrending the data, the function isolates the cyclical components, making it easier to analyze and interpret the underlying market dynamics.
The detrend logarithmic zero-lag regression function is used in the indicator to isolate the cyclical components of the input data. By detrending the data, the function enables the indicator to focus on the cyclical movements in the market, making it easier to analyze and interpret market dynamics. This function is essential for identifying cyclical patterns and understanding the interactions between different market cycles, which can inform trading decisions and enhance overall market understanding.
Bartels Cycle Significance Test:
The Bartels cycle significance test is a function that combines the Bartels probability function and the detrend logarithmic zero-lag regression function to assess the significance of detected cycles. The function calculates the Bartels probability for each cycle and stores the results in an array. By analyzing the probability values, traders and analysts can identify the most significant cycles in the data, which can be used to develop trading strategies and improve market understanding.
The Bartels cycle significance test function is integrated into the indicator to provide a comprehensive analysis of the significance of detected cycles. By combining the Bartels probability function and the detrend logarithmic zero-lag regression function, this test evaluates the significance of each cycle and stores the results in an array. The indicator can then use this information to prioritize the most significant cycles and focus on the most relevant market dynamics. This function enhances the indicator's ability to identify and analyze dominant market cycles, providing valuable insights for trading and market analysis.
Hodrick-Prescott Filter:
The Hodrick-Prescott filter is a popular technique used to separate the trend and cyclical components of a time series. The function applies a smoothing parameter to the input data and calculates a smoothed series using a two-sided filter. This smoothed series represents the trend component, which can be subtracted from the original data to obtain the cyclical component. The Hodrick-Prescott filter is commonly used in economics and finance to analyze economic data and financial market trends.
The Hodrick-Prescott filter is incorporated into the indicator to separate the trend and cyclical components of the input data. By applying the filter to the data, the indicator can isolate the trend component, which can be used to analyze long-term market trends and inform trading decisions. Additionally, the cyclical component can be used to identify shorter-term market dynamics and provide insights into potential trading opportunities. The inclusion of the Hodrick-Prescott filter adds another layer of analysis to the indicator, making it more versatile and comprehensive.
Detrending Options: Detrend Centered Moving Average:
The detrend centered moving average function provides different detrending methods, including the Hodrick-Prescott filter and the zero-lag moving average, based on the selected detrending method. The function calculates two sets of smoothed values using the chosen method and subtracts one set from the other to obtain a detrended series. By offering multiple detrending options, this function allows traders and analysts to select the most appropriate method for their specific needs and preferences.
The detrend centered moving average function is integrated into the indicator to provide users with multiple detrending options, including the Hodrick-Prescott filter and the zero-lag moving average. By offering multiple detrending methods, the indicator allows users to customize the analysis to their specific needs and preferences, enhancing the indicator's overall utility and adaptability. This function ensures that the indicator can cater to a wide range of trading styles and objectives, making it a valuable tool for a diverse group of market participants.
The auxiliary functions functions discussed in this section demonstrate the power and versatility of mathematical techniques in analyzing financial markets. By understanding and implementing these functions, traders and analysts can gain valuable insights into market dynamics, improve their trading strategies, and make more informed decisions. The combination of zero-lag moving averages, Bartels probability, detrending methods, and the Hodrick-Prescott filter provides a comprehensive toolkit for analyzing and interpreting financial data. The integration of advanced functions in a financial indicator creates a powerful and versatile analytical tool that can provide valuable insights into financial markets. By combining the zero-lag moving average,
█ In-Depth Analysis of the Goertzel Browser Code
The Goertzel Browser code is an implementation of the Goertzel Algorithm, an efficient technique to perform spectral analysis on a signal. The code is designed to detect and analyze dominant cycles within a given financial market data set. This section will provide an extremely detailed explanation of the code, its structure, functions, and intended purpose.
Function signature and input parameters:
The Goertzel Browser function accepts numerous input parameters for customization, including source data (src), the current bar (forBar), sample size (samplesize), period (per), squared amplitude flag (squaredAmp), addition flag (useAddition), cosine flag (useCosine), cycle strength flag (UseCycleStrength), past and future window sizes (WindowSizePast, WindowSizeFuture), Bartels filter flag (FilterBartels), Bartels-related parameters (BartNoCycles, BartSmoothPer, BartSigLimit), sorting flag (SortBartels), and output buffers (goeWorkPast, goeWorkFuture, cyclebuffer, amplitudebuffer, phasebuffer, cycleBartelsBuffer).
Initializing variables and arrays:
The code initializes several float arrays (goeWork1, goeWork2, goeWork3, goeWork4) with the same length as twice the period (2 * per). These arrays store intermediate results during the execution of the algorithm.
Preprocessing input data:
The input data (src) undergoes preprocessing to remove linear trends. This step enhances the algorithm's ability to focus on cyclical components in the data. The linear trend is calculated by finding the slope between the first and last values of the input data within the sample.
Iterative calculation of Goertzel coefficients:
The core of the Goertzel Browser algorithm lies in the iterative calculation of Goertzel coefficients for each frequency bin. These coefficients represent the spectral content of the input data at different frequencies. The code iterates through the range of frequencies, calculating the Goertzel coefficients using a nested loop structure.
Cycle strength computation:
The code calculates the cycle strength based on the Goertzel coefficients. This is an optional step, controlled by the UseCycleStrength flag. The cycle strength provides information on the relative influence of each cycle on the data per bar, considering both amplitude and cycle length. The algorithm computes the cycle strength either by squaring the amplitude (controlled by squaredAmp flag) or using the actual amplitude values.
Phase calculation:
The Goertzel Browser code computes the phase of each cycle, which represents the position of the cycle within the input data. The phase is calculated using the arctangent function (math.atan) based on the ratio of the imaginary and real components of the Goertzel coefficients.
Peak detection and cycle extraction:
The algorithm performs peak detection on the computed amplitudes or cycle strengths to identify dominant cycles. It stores the detected cycles in the cyclebuffer array, along with their corresponding amplitudes and phases in the amplitudebuffer and phasebuffer arrays, respectively.
Sorting cycles by amplitude or cycle strength:
The code sorts the detected cycles based on their amplitude or cycle strength in descending order. This allows the algorithm to prioritize cycles with the most significant impact on the input data.
Bartels cycle significance test:
If the FilterBartels flag is set, the code performs a Bartels cycle significance test on the detected cycles. This test determines the statistical significance of each cycle and filters out the insignificant cycles. The significant cycles are stored in the cycleBartelsBuffer array. If the SortBartels flag is set, the code sorts the significant cycles based on their Bartels significance values.
Waveform calculation:
The Goertzel Browser code calculates the waveform of the significant cycles for both past and future time windows. The past and future windows are defined by the WindowSizePast and WindowSizeFuture parameters, respectively. The algorithm uses either cosine or sine functions (controlled by the useCosine flag) to calculate the waveforms for each cycle. The useAddition flag determines whether the waveforms should be added or subtracted.
Storing waveforms in matrices:
The calculated waveforms for each cycle are stored in two matrices - goeWorkPast and goeWorkFuture. These matrices hold the waveforms for the past and future time windows, respectively. Each row in the matrices represents a time window position, and each column corresponds to a cycle.
Returning the number of cycles:
The Goertzel Browser function returns the total number of detected cycles (number_of_cycles) after processing the input data. This information can be used to further analyze the results or to visualize the detected cycles.
The Goertzel Browser code is a comprehensive implementation of the Goertzel Algorithm, specifically designed for detecting and analyzing dominant cycles within financial market data. The code offers a high level of customization, allowing users to fine-tune the algorithm based on their specific needs. The Goertzel Browser's combination of preprocessing, iterative calculations, cycle extraction, sorting, significance testing, and waveform calculation makes it a powerful tool for understanding cyclical components in financial data.
█ Generating and Visualizing Composite Waveform
The indicator calculates and visualizes the composite waveform for both past and future time windows based on the detected cycles. Here's a detailed explanation of this process:
Updating WindowSizePast and WindowSizeFuture:
The WindowSizePast and WindowSizeFuture are updated to ensure they are at least twice the MaxPer (maximum period).
Initializing matrices and arrays:
Two matrices, goeWorkPast and goeWorkFuture, are initialized to store the Goertzel results for past and future time windows. Multiple arrays are also initialized to store cycle, amplitude, phase, and Bartels information.
Preparing the source data (srcVal) array:
The source data is copied into an array, srcVal, and detrended using one of the selected methods (hpsmthdt, zlagsmthdt, logZlagRegression, hpsmth, or zlagsmth).
Goertzel function call:
The Goertzel function is called to analyze the detrended source data and extract cycle information. The output, number_of_cycles, contains the number of detected cycles.
Initializing arrays for past and future waveforms:
Three arrays, epgoertzel, goertzel, and goertzelFuture, are initialized to store the endpoint Goertzel, non-endpoint Goertzel, and future Goertzel projections, respectively.
Calculating composite waveform for past bars (goertzel array):
The past composite waveform is calculated by summing the selected cycles (either from the user-defined cycle list or the top cycles) and optionally subtracting the noise component.
Calculating composite waveform for future bars (goertzelFuture array):
The future composite waveform is calculated in a similar way as the past composite waveform.
Drawing past composite waveform (pvlines):
The past composite waveform is drawn on the chart using solid lines. The color of the lines is determined by the direction of the waveform (green for upward, red for downward).
Drawing future composite waveform (fvlines):
The future composite waveform is drawn on the chart using dotted lines. The color of the lines is determined by the direction of the waveform (fuchsia for upward, yellow for downward).
Displaying cycle information in a table (table3):
A table is created to display the cycle information, including the rank, period, Bartel value, amplitude (or cycle strength), and phase of each detected cycle.
Filling the table with cycle information:
The indicator iterates through the detected cycles and retrieves the relevant information (period, amplitude, phase, and Bartel value) from the corresponding arrays. It then fills the table with this information, displaying the values up to six decimal places.
To summarize, this indicator generates a composite waveform based on the detected cycles in the financial data. It calculates the composite waveforms for both past and future time windows and visualizes them on the chart using colored lines. Additionally, it displays detailed cycle information in a table, including the rank, period, Bartel value, amplitude (or cycle strength), and phase of each detected cycle.
█ Enhancing the Goertzel Algorithm-Based Script for Financial Modeling and Trading
The Goertzel algorithm-based script for detecting dominant cycles in financial data is a powerful tool for financial modeling and trading. It provides valuable insights into the past behavior of these cycles and potential future impact. However, as with any algorithm, there is always room for improvement. This section discusses potential enhancements to the existing script to make it even more robust and versatile for financial modeling, general trading, advanced trading, and high-frequency finance trading.
Enhancements for Financial Modeling
Data preprocessing: One way to improve the script's performance for financial modeling is to introduce more advanced data preprocessing techniques. This could include removing outliers, handling missing data, and normalizing the data to ensure consistent and accurate results.
Additional detrending and smoothing methods: Incorporating more sophisticated detrending and smoothing techniques, such as wavelet transform or empirical mode decomposition, can help improve the script's ability to accurately identify cycles and trends in the data.
Machine learning integration: Integrating machine learning techniques, such as artificial neural networks or support vector machines, can help enhance the script's predictive capabilities, leading to more accurate financial models.
Enhancements for General and Advanced Trading
Customizable indicator integration: Allowing users to integrate their own technical indicators can help improve the script's effectiveness for both general and advanced trading. By enabling the combination of the dominant cycle information with other technical analysis tools, traders can develop more comprehensive trading strategies.
Risk management and position sizing: Incorporating risk management and position sizing functionality into the script can help traders better manage their trades and control potential losses. This can be achieved by calculating the optimal position size based on the user's risk tolerance and account size.
Multi-timeframe analysis: Enhancing the script to perform multi-timeframe analysis can provide traders with a more holistic view of market trends and cycles. By identifying dominant cycles on different timeframes, traders can gain insights into the potential confluence of cycles and make better-informed trading decisions.
Enhancements for High-Frequency Finance Trading
Algorithm optimization: To ensure the script's suitability for high-frequency finance trading, optimizing the algorithm for faster execution is crucial. This can be achieved by employing efficient data structures and refining the calculation methods to minimize computational complexity.
Real-time data streaming: Integrating real-time data streaming capabilities into the script can help high-frequency traders react to market changes more quickly. By continuously updating the cycle information based on real-time market data, traders can adapt their strategies accordingly and capitalize on short-term market fluctuations.
Order execution and trade management: To fully leverage the script's capabilities for high-frequency trading, implementing functionality for automated order execution and trade management is essential. This can include features such as stop-loss and take-profit orders, trailing stops, and automated trade exit strategies.
While the existing Goertzel algorithm-based script is a valuable tool for detecting dominant cycles in financial data, there are several potential enhancements that can make it even more powerful for financial modeling, general trading, advanced trading, and high-frequency finance trading. By incorporating these improvements, the script can become a more versatile and effective tool for traders and financial analysts alike.
█ Understanding the Limitations of the Goertzel Algorithm
While the Goertzel algorithm-based script for detecting dominant cycles in financial data provides valuable insights, it is important to be aware of its limitations and drawbacks. Some of the key drawbacks of this indicator are:
Lagging nature:
As with many other technical indicators, the Goertzel algorithm-based script can suffer from lagging effects, meaning that it may not immediately react to real-time market changes. This lag can lead to late entries and exits, potentially resulting in reduced profitability or increased losses.
Parameter sensitivity:
The performance of the script can be sensitive to the chosen parameters, such as the detrending methods, smoothing techniques, and cycle detection settings. Improper parameter selection may lead to inaccurate cycle detection or increased false signals, which can negatively impact trading performance.
Complexity:
The Goertzel algorithm itself is relatively complex, making it difficult for novice traders or those unfamiliar with the concept of cycle analysis to fully understand and effectively utilize the script. This complexity can also make it challenging to optimize the script for specific trading styles or market conditions.
Overfitting risk:
As with any data-driven approach, there is a risk of overfitting when using the Goertzel algorithm-based script. Overfitting occurs when a model becomes too specific to the historical data it was trained on, leading to poor performance on new, unseen data. This can result in misleading signals and reduced trading performance.
No guarantee of future performance: While the script can provide insights into past cycles and potential future trends, it is important to remember that past performance does not guarantee future results. Market conditions can change, and relying solely on the script's predictions without considering other factors may lead to poor trading decisions.
Limited applicability: The Goertzel algorithm-based script may not be suitable for all markets, trading styles, or timeframes. Its effectiveness in detecting cycles may be limited in certain market conditions, such as during periods of extreme volatility or low liquidity.
While the Goertzel algorithm-based script offers valuable insights into dominant cycles in financial data, it is essential to consider its drawbacks and limitations when incorporating it into a trading strategy. Traders should always use the script in conjunction with other technical and fundamental analysis tools, as well as proper risk management, to make well-informed trading decisions.
█ Interpreting Results
The Goertzel Browser indicator can be interpreted by analyzing the plotted lines and the table presented alongside them. The indicator plots two lines: past and future composite waves. The past composite wave represents the composite wave of the past price data, and the future composite wave represents the projected composite wave for the next period.
The past composite wave line displays a solid line, with green indicating a bullish trend and red indicating a bearish trend. On the other hand, the future composite wave line is a dotted line with fuchsia indicating a bullish trend and yellow indicating a bearish trend.
The table presented alongside the indicator shows the top cycles with their corresponding rank, period, Bartels, amplitude or cycle strength, and phase. The amplitude is a measure of the strength of the cycle, while the phase is the position of the cycle within the data series.
Interpreting the Goertzel Browser indicator involves identifying the trend of the past and future composite wave lines and matching them with the corresponding bullish or bearish color. Additionally, traders can identify the top cycles with the highest amplitude or cycle strength and utilize them in conjunction with other technical indicators and fundamental analysis for trading decisions.
This indicator is considered a repainting indicator because the value of the indicator is calculated based on the past price data. As new price data becomes available, the indicator's value is recalculated, potentially causing the indicator's past values to change. This can create a false impression of the indicator's performance, as it may appear to have provided a profitable trading signal in the past when, in fact, that signal did not exist at the time.
The Goertzel indicator is also non-endpointed, meaning that it is not calculated up to the current bar or candle. Instead, it uses a fixed amount of historical data to calculate its values, which can make it difficult to use for real-time trading decisions. For example, if the indicator uses 100 bars of historical data to make its calculations, it cannot provide a signal until the current bar has closed and become part of the historical data. This can result in missed trading opportunities or delayed signals.
█ Conclusion
The Goertzel Browser indicator is a powerful tool for identifying and analyzing cyclical patterns in financial markets. Its ability to detect multiple cycles of varying frequencies and strengths make it a valuable addition to any trader's technical analysis toolkit. However, it is important to keep in mind that the Goertzel Browser indicator should be used in conjunction with other technical analysis tools and fundamental analysis to achieve the best results. With continued refinement and development, the Goertzel Browser indicator has the potential to become a highly effective tool for financial modeling, general trading, advanced trading, and high-frequency finance trading. Its accuracy and versatility make it a promising candidate for further research and development.
█ Footnotes
What is the Bartels Test for Cycle Significance?
The Bartels Cycle Significance Test is a statistical method that determines whether the peaks and troughs of a time series are statistically significant. The test is named after its inventor, George Bartels, who developed it in the mid-20th century.
The Bartels test is designed to analyze the cyclical components of a time series, which can help traders and analysts identify trends and cycles in financial markets. The test calculates a Bartels statistic, which measures the degree of non-randomness or autocorrelation in the time series.
The Bartels statistic is calculated by first splitting the time series into two halves and calculating the range of the peaks and troughs in each half. The test then compares these ranges using a t-test, which measures the significance of the difference between the two ranges.
If the Bartels statistic is greater than a critical value, it indicates that the peaks and troughs in the time series are non-random and that there is a significant cyclical component to the data. Conversely, if the Bartels statistic is less than the critical value, it suggests that the peaks and troughs are random and that there is no significant cyclical component.
The Bartels Cycle Significance Test is particularly useful in financial analysis because it can help traders and analysts identify significant cycles in asset prices, which can in turn inform investment decisions. However, it is important to note that the test is not perfect and can produce false signals in certain situations, particularly in noisy or volatile markets. Therefore, it is always recommended to use the test in conjunction with other technical and fundamental indicators to confirm trends and cycles.
Deep-dive into the Hodrick-Prescott Fitler
The Hodrick-Prescott (HP) filter is a statistical tool used in economics and finance to separate a time series into two components: a trend component and a cyclical component. It is a powerful tool for identifying long-term trends in economic and financial data and is widely used by economists, central banks, and financial institutions around the world.
The HP filter was first introduced in the 1990s by economists Robert Hodrick and Edward Prescott. It is a simple, two-parameter filter that separates a time series into a trend component and a cyclical component. The trend component represents the long-term behavior of the data, while the cyclical component captures the shorter-term fluctuations around the trend.
The HP filter works by minimizing the following objective function:
Minimize: (Sum of Squared Deviations) + λ (Sum of Squared Second Differences)
Where:
The first term represents the deviation of the data from the trend.
The second term represents the smoothness of the trend.
λ is a smoothing parameter that determines the degree of smoothness of the trend.
The smoothing parameter λ is typically set to a value between 100 and 1600, depending on the frequency of the data. Higher values of λ lead to a smoother trend, while lower values lead to a more volatile trend.
The HP filter has several advantages over other smoothing techniques. It is a non-parametric method, meaning that it does not make any assumptions about the underlying distribution of the data. It also allows for easy comparison of trends across different time series and can be used with data of any frequency.
However, the HP filter also has some limitations. It assumes that the trend is a smooth function, which may not be the case in some situations. It can also be sensitive to changes in the smoothing parameter λ, which may result in different trends for the same data. Additionally, the filter may produce unrealistic trends for very short time series.
Despite these limitations, the HP filter remains a valuable tool for analyzing economic and financial data. It is widely used by central banks and financial institutions to monitor long-term trends in the economy, and it can be used to identify turning points in the business cycle. The filter can also be used to analyze asset prices, exchange rates, and other financial variables.
The Hodrick-Prescott filter is a powerful tool for analyzing economic and financial data. It separates a time series into a trend component and a cyclical component, allowing for easy identification of long-term trends and turning points in the business cycle. While it has some limitations, it remains a valuable tool for economists, central banks, and financial institutions around the world.
Nifty and Bank Nifty Dashboard V2This shows a performance glance of Dow and major Constituents of NSE:NIFTY or NSE:BANKNIFTY . This is an enhancement to the Bank nifty dashboard published earlier.
Usage
• Customizable Table and Style settings
• Customizable Indicator Settings
• Customizable Time frame of Indicators in Table. Can change to higher or lower TF other than the chart time frame
• Customizable Input symbols. Can modify with the Scripts you want to track.
• The Last row will be the current script viewed in charts.
• Can enable or disable indicators on the chart like ST, SMA, VWAP.
• Strong Volume Indication at bottom based on the average volume inputs for Nifty, Bank Nifty and for other stocks volume > 20 ma(volume)
• Displays bank nifty stocks if Bank nifty is the open chart else it will display top Nifty Stocks.
• This will help to monitor the performance of various scripts.
• Can change the stock list according to usage/Index.
• It will show all the symbols if Additional Symbols is selected.
Buy-Sell Signal
• Volume > Average Volume, it Shows #
• ST – Buy - Price > Super trend (10,2) and vice versa
• SMA – Buy - Price > MA and vice versa
• RSI – Buy – RSI > 50, Sell – RSI < 40
• ADX: Buy - ADX > 25, DMI+ Above DMI - and vice versa
• Previous day High low is not considered for buy or sell score calculation. This is just for additional observation.
• ATR will be highlighted when change > 0.75 of the average true range of daily price.
Strong colours will be shown for respective boxes when some additional conditions satisfy.
Style settings
Dashboard Location: Location of the dashboard on the chart
Dashboard Size: The size of the dashboard on the chart
Text/Frame Color: Determines the colour of the frame grid as well as the text colour
Bullish Cell Color: Determines the colour of cell associated with a rising indicator direction
Bearish Cell Color: Determines the colour of cell associated with a decreasing indicator direction
Cell Transparency: Transparency of each cell
Perfect zonesAs the name says this script will be perfect.
There are 2 types of indicators in the market. Leading and Lagging.
I always prefer to choose a leading which can help me determine my trades future hand.
This script provides few levels which are not just leading but also perfect. This script can be used only on the current day/week/month and can't be used to predict the next sessions movement as this script uses current open price.
Open line - Line drawn based on the open of the candle. I feel this is one of the underrated line. This is a very powerful resistance and support line.
Average 10 days levels - These are just calculated based on average 10 previous days.
Logic is - since the script has stayed within the range for past 10 days it remains to stay in the same levels even today.
So on average this levels works 8/10 times which is very bigger in stock market.
Fibonnaci levels zones - This zone is derived from Thomas de-mark book. This is also a simple level where fibonnaci ratio is used to determine the levels from today's open.
Outer levels - They are also same fibonacci levels which are very much respected by all the stocks and indices.
Provided adjustment levels to determine the range for Day/Week/Month.
Added some code from one of my favorite indicator variable moving average. Thanks to the author of the script.
How to trade using this script.
Apply 10 days average and Fibonacci level zones in the chart
Range bound movement
When the stock open. Try to predict from price action whether the stock is going to be in a small range. Then do a strangle of the strikes just outside the zone.
Trending movement
When the stock seems to be little volatile both the levels applied act a good resistance. Take positions once the range in broken or reversal is happening from the level.
This script is unique because these are not drawn levels based on previous day unlike pivot or Fibonacci, current day open is important in this script.
tip - Use it in banknifty and Nifty with Range bound strategy I have mentioned above.
Happy trading.
Honeybee59-forex 2.0Honeybee59-forex 2.0 for TradingView gives you abilities to see the stories hiding in the graphs of forex, and crypto currency markets. It counts CC59 and creates respectable support and resistance levels as well as marks and reminds you about important parameters that are happening in the graph so that you will not forget to consider them before placing orders. This set of tools is a simplified version of Graph Reader Pro for TradingView customized for planning your investments in forex. These parameters include:
* Automatic CC59 counting that compares the close of the right price bar to that of left price bar in a group of 5 consecutive bars (ignoring 3 bars in the middle). If the right bar closed higher, the count positive number would be printed above the bar. If the right bar closed lower, the count negative number would be printed below the bar. Nine consecutive series of up counts will define the lowest price as CC59 support light blue line and nine consecutive series of down counts will define the highest price as CC59 resistance orange line. The counted numbers, support and resistance lines are automatically printed on the graph if enabled.
* Draw a reconfigurable simple moving average ( MySMA ) white line. The default setting is SMA3.
* Draw the high and low of the previous day green lines, if enabled. The Previous Day's High and Low are often used as reversal levels in the few future days.
* Draw a popular SMA13 red line.
* Draw a Pullback level pink line near the beginning of a possible new trend.
* Draw High Of the Day and Low of the Day yellow lines for the most recent high and low levels of today.
* Paint the background areas with active Forex trading of Asian, London, and New York sessions, if enabled.
* Print "Working High" and "Working Low" when the price hits previous day's High and Low levels.
* Print "MMM" when there is a possible Market Maker's Manipulation (price bar range is larger than recent average value by a reconfigurable factor, 3 times by default).
* Print "RSI>70" and "RSI<70" for RSI (14) that crosses above 70 % and below 70 %.
* Print "RSI<30" and "RSI>30" for RSI (14) that crosses below 30 % and above 30 %.
* Print "Max" and "Min" for local maximum and local minimum bars.
* Print "Gap" when there is a gap between neighboring price bars. The opened gaps are often closed later on. Hence, they are milestones for the price to come back and close them up.
* Print "MACD>Sig" and "MACDMySMA" and "C Dark".
For free TradingView plan, you can add two more indicators to the chart. That means you may add RSI and MACD indicators with same parameters as those setup in Honeybee59-forex to your graph. DrGraph regularly publishes his educational ideas on using features provided in Honeybee59-forex for profitable investments. You can follow him for how to use the tools in trading forex, and crypto currencies.
Honeybee59-forex 1.0Honeybee59-forex 1.0 for TradingView gives you abilities to see the stories hiding in the graphs of forex, and crypto currency markets. It counts CC59 and creates respectable support and resistance levels as well as marks and reminds you about important parameters that are happening in the graph so that you will not forget to consider them before placing orders. This set of tools is a simplified version of Graph Reader Pro for TradingView customized for planning your investments in stocks. This set of tools is a simplified version of Graph Reader Pro for TradingView customized for planning your investments in forex. These parameters include:
* Automatic CC59 counting that compares the close of the right price bar to that of left price bar in a group of 5 consecutive bars (ignoring 3 bars in the middle). If the right bar closed higher, the count positive number would be printed above the bar. If the right bar closed lower, the count negative number would be printed below the bar. Nine consecutive series of up counts will define the lowest price as CC59 support line and nine consecutive series of down counts will define the highest price as CC59 resistance line. The counted numbers, support and resistance lines are automatically printed on the graph if enabled.
* Draw a reconfigurable simple moving average ( MySMA ) yellow line. The default setting is SMA3.
* Draw the high and low levels of the previous day (green), if enabled. The Previous Day's High and Low are often used as reversal levels in the few future days.
* Draw a popular SMA13 line (light blue).
* Draw a Pullback level line (pink) near the beginning of a possible new trend.
* Draw High Of the Day and Low of the Day (yellow) for the most recent high and low levels of today.
* Paint the background areas with active Forex trading of Asian, London, and New York sessions, if enabled.
* Print "Working High" and "Working Low" when the price hits previous day's High and Low levels.
* Print "MMM" when there is a possible Market Maker's Manipulation (price bar range is larger than recent average value by a reconfigurable factor, 3 times by default).
* Print "RSI>70" and "RSI<70" for RSI(14) that crosses above 70 % and below 70 %.
* Print "RSI<30" and "RSI>30" for RSI(14) that crosses below 30 % and above 30 %.
* Print "Max" and "Min" for local maximum and local minimum bars.
* Print "Gap" when there is a gap between neighboring price bars. The opened gaps are often closed later on. Hence, they are milestones for the price to come back and close them up.
* Print "MACD>Sig" and "MACDMySMA" and "C Dark".
For free TradingView plan, you can add two more indicators to the chart. That means you may add RSI and MACD indicators with same parameters as those setup in Honeybee59-forex to your graph. DrGraph regularly publishes his educational ideas on using features provided in Honeybee59-forex for profitable investments. You can follow him for how to use the tools in trading forex, and crypto currencies.
Honeybee59-stock 2.0Honeybee59-stock for TradingView gives you abilities to see the stories hiding in the graphs of stocks. It counts CC59 and creates respectable support and resistance levels as well as marks and reminds you about important parameters that are happening in the graph so that you will not forget to consider them before placing orders. This set of tools is a simplified version of Graph Reader Pro for TradingView customized for planning your investments in stocks.
Features:
*Automatic CC59 counting that compares the close of the right price bar to that of left price bar in a group of 5 consecutive bars (ignoring 3 bars in the middle). If the right bar closed higher, the count positive number would be printed above the bar. If the right bar closed lower, the count negative number would be printed below the bar. Nine consecutive series of up counts will define the lowest price as CC59 support line and nine consecutive series of down counts will define the highest price as CC59 resistance line. The counted numbers, support and resistance lines are automatically printed on the graph if enabled.
* Draw a reconfigurable simple moving average ( MySMA ) yellow line. The default setting is SMA3.
* Draw a popular SMA13 line (light blue).
* Draw a pullback level line (pink) near the beginning of a possible new trend.
* Print "C>MySMA" or "C70" and "RSI<70" for RSI(14) that crosses above 70 % and below 70 %.
* Print "RSI<30" and "RSI>30" for RSI(14) that crosses below 30 % and above 30 %.
* Print "Max" and "Min" for local maximum and local minimum bars.
* Print "Gap" when there is a gap between neighboring price bars. The opened gaps are often closed later on. Hence, they are milestones for the price to come back and close them up.
* Print "MACD>Sig" and "MACD Dark".
For free TradingView plan, you can add two more indicators to the chart. That means you may add RSI and MACD indicators with same parameters as those setup in Honeybee59-stock to your graph. DrGraph regularly publishes his educational ideas on using features provided in Honeybee59-stock for profitable investments. You can follow him for how to use the tools in trading stocks.
Honeybee59-stock
Honeybee59-stock for TradingView gives you abilities to see the stories hiding in the graphs of stocks. It counts CC59 and creates respectable support and resistance levels as well as marks and reminds you about important parameters that are happening in the graph so that you will not forget to consider them before placing orders. This set of tools is a simplified version of Graph Reader Pro for TradingView customized for planning your investments in stocks.
Features:
*Automatic CC59 counting that compares the close of the right price bar to that of left price bar in a group of 5 consecutive bars (ignoring 3 bars in the middle). If the right bar closed higher, the count positive number would be printed above the bar. If the right bar closed lower, the count negative number would be printed below the bar. Nine consecutive series of up counts will define the lowest price as CC59 support line and nine consecutive series of down counts will define the highest price as CC59 resistance line. The counted numbers, support and resistance lines are automatically printed on the graph if enabled.
*Draw a reconfigurable simple moving average (SMA) line.
*Print "Up" or "Down" when the price closes above or below the SMA line.
*Print "Gap" when there is a gap between neighboring price bars. The opened gaps are often closed later on. Hence, they are milestones for the price to come back and close them up.
*Print "RSI>70" and "RSI<70" for RSI (14) that crossed above 70 % and below 70 %.
*Print "RSI<30" and "RSI>30" for RSI (14) that crossed below 30 % and above 30 %.
*Print "MACD>Sig" and "MACD Dark".
For free TradingView plan, you can add two more indicators to the chart. That means you may add RSI and MACD indicators with same parameters as those setup in Honeybee59-stock to your graph. DrGraph regularly publishes his educational ideas on using features provided in Honeybee59-stock for profitable investments. You can follow him for how to use the tools in trading stocks.
Graph Reader Pro 5.0Graph Reader Pro 5.0 for TradingView gives you abilities to see the stories hiding in the graphs of the stock, forex, and crypto currency markets. It counts CC59 and creates respectable support and resistance levels as well as marks and reminds you about important parameters that are happening in the graph so that you will not forget to consider them before placing orders. These parameters include:
Automatic CC59 counting that compares the close of the right price bar to that of left price bar in a group of 5 consecutive bars (ignoring 3 bars in the middle). If the right bar closed higher, the count positive number would be printed above the bar. If the right bar closed lower, the count negative number would be printed below the bar. Nine consecutive series of up counts will define the lowest price as CC59 support line and nine consecutive series of down counts will define the highest price as CC59 resistance line. The counted numbers, support and resistance lines are automatically printed on the graph if enabled.
Draw the high and low levels of the previous day, if enabled. The Previous Day's High and Low are often used as reversal levels in the few future days.
Draw the price range of each day based on Average Daily Range (ADR) value. These lines only show in graphs with less than daily time frames.
Draw the price range of each week based on Average Weekly Range (AWR) value. These lines only show in daily graphs.
Draw simple moving average line SMA3 (yellow), SMA13 (green), SMA50 (pink), and SMA200 (white).
Draw Bollinger bands (50,2) upper and lower lines (pink) with SMA50 as a center line (pink).
Locate the price gaps in the graphs of stocks and indexes. The opened gaps are often closed later on. Hence, they are milestones for the price to come back and close them up.
Paint the background areas with active Forex trading of Asian, London, and New York sessions, if enabled.
Locate an engulfing bar that cover the previous bar with a body portion less than 50% of its range.
Locate an anchor bar that has the range (High - Low) larger than those 14 bars earlier.
Print "RSI>70" and "RSI<70" for RSI(14) that crossed above 70 % and below 70 %.
Print "RSI<30" and "RSI>30" for RSI(14) that crossed below 30 % and above 30 %.
Print "MACD>Sig" and "MACD0" and "MACD<0" for MACD(12,26,9) that crossed above and below zero.
Print "Max" and "Min" for local maximum and local minimum bars.
Print "MA3>13>50" and "MA3<13<50" for ordering of SMA(3,13,50).
Create alarm conditions for the following events that could be set to notify the investor on screen, to an email and to a smart phone:
"Close above MA3"
"Close under MA3"
"Close above MA13"
"Close under MA13"
"Close above MA50"
"Close under MA50"
"Close above MA200"
"Close under MA200"
"MACD up"
"MACD down"
"MACD>Sig"
"MACD0"
"MACD<0"
"MA3 up"
"MA3 down"
"MA13 up"
"MA13 down"
"MA50 up"
"MA50 down"
"CC59 = -1"
"CC59 = +1"
"CC59 = -9"
"CC59 = +9"
"CC59 = -9F"
"CC59 = +9F"
"MA3 < MA13"
"MA3 > MA13"
"MA13 < MA50"
"MA13 > MA50"
"(MA3 < MA13) > MA50"
"MA50 > (MA3 > MA13)"
"MA3 > MA13 > MA50"
"MA3 < MA13 < MA50"
"RSI<30"
"RSI>30"
"RSI<50"
"RSI>50"
"RSI<70"
"RSI>70"
"Hit yesterday's high"
"Hit yesterday's low"
"Hit day open + ADR/2"
"Hit day open"
"Hit day open - ADR/2"
"Hit CC59 resistance"
"Hit CC59 support"
=================================================================================================
The source code of Graph Reader Pro 5.0 custom indicator is protected.
Only invited TradingView members can apply this indicator to their forex, crypto currency and stock price graphs.
Lifetime invitation is for 100 USD with free future upgrades and online supports.
Rental invitation is for 10 USD/month with free future upgrades and online supports.
Paypal, Bank transfer and Bitcoin payments are welcome.
For more informaton please contact the author (DrGraph or Nimit Chomnawang, PhD) via TradingView private chat
or in the comment field below.
=================================================================================================
How to install the script:
------------------------------
*Go to the bottom of this page and click on "Add to Favorite Scripts".
*Remove older version Graph Reader Pro by clicking on the "X" botton behind the indicator line at the top left corner of the chart window.
*Open a new chart at and click on the "Indicators" tab.
*Click on the "Favorites" tab and choose "Graph Reader Pro 5.0".
*Right click anywhere on the graph, choose "Settings".
*In "Style" tab, choose the Dark Theme.
*In "Scales" tab, select Decimal Places = 1/100000.
*In "Background" tab, uncheck "Indicator Arguments" and "Indicator Values".
*In "Timezone/Sessions" tab, choose Time Zone = Your local time.
*At the bottom of settings window, click on "Template", "Save As...", then name this theme of graph setting for future call up such as "Graph Reader Pro".
*Click OK.
*Right click anywhere on the graph, choose "Color Theme => Dark".
For free TradingView plan, you can add two more indicators to the chart. That means you may add RSI and MACD indicators with same parameters as those setup in Graph Reader Pro to your graph. DrGraph regularly publishes his educational ideas on using features provided in Graph Reader Pro for profitable investments. You can follow him for how to use the tools in trading stocks, forex, and binary options.
Graph Reader Pro 4.0Graph Reader Pro 4.0 for TradingView gives you abilities to see the stories hiding in the graphs of the stock, forex, and crypto currency markets. It counts CC59 and creates respectable support and resistance levels as well as marks and reminds you about important parameters that are happening in the graph so that you will not forget to consider them before placing orders. These parameters include:
Automatic CC59 counting that compares the close of the right price bar to that of left price bar in a group of 5 consecutive bars (ignoring 3 bars in the middle). If the right bar closed higher, the count positive number would be printed above the bar. If the right bar closed lower, the count negative number would be printed below the bar. Nine consecutive series of up counts will define the lowest price as CC59 support line and nine consecutive series of down counts will define the highest price as CC59 resistance line. The counted numbers, support and resistance lines are automatically printed on the graph if enabled.
Draw the high and low levels of the previous day, if enabled. The Previous Day's High and Low are often used as reversal levels in the few future days.
Draw the price range of each day based on Average Daily Range (ADR) value. These lines only show in graphs with less than daily time frames.
Draw the price range of each week based on Average Weekly Range (AWR) value. These lines only show in daily graphs.
Draw simple moving average line SMA3, with ability to change the line color based on increasing or decreasing MACD value.
Draw simple moving average line SMA50, with ability to change the line color based on its own increasing or decreasing value.
Locate the price gaps in the graphs of stocks and indexes. The opened gaps are often closed later on. Hence, they are milestones for the price to come back and close them up.
Draw a ribbon of simple moving average lines consisting of SMA3, SMA4, SMA5, SMA6 and SMA7, if enabled. Twisting of the SMA ribbon gives a visual signal for price reversal.
Draw a set of other simple moving average lines such as SMA13, SMA200, SMA800 (if enabled).
Paint the background areas with active Forex trading of Asian, London, and New York sessions, if enabled.
Locate an engulfing bar that cover the previous bar with a body portion less than 50% of its range.
Locate an anchor bar that has the range (High - Low) larger than those 14 bars earlier.
Print "RSI>70" and "RSI<70" for RSI(14) that crossed above 70 % and below 70 %.
Print "RSI<30" and "RSI>30" for RSI(14) that crossed below 30 % and above 30 %.
Print "RSI<50" and "RSI>50" for RSI(14) that crossed below 50 % and above 50 %.
Print "MACD>Sig" and "MACD0" and "MACD<0" for MACD(12,26,9) that crossed above and below zero.
Print "Max" and "Min" for local maximum and local minimum bars.
Print "SMA5>13" and "SMA5<13" for SMA(5) crossed above and below SMA(13).
Print "Highest" and "Lowest" at the highest and lowest prices in a group of configurable number of bars earlier.
=================================================================================================
The source code of Graph Reader Pro 4.0 custom indicator is protected.
Only invited TradingView members can apply this indicator to their forex, crypto currency and stock price graphs.
Lifetime invitation is for 100 USD with free future upgrades and online supports.
Rental invitation is for 10 USD/month with free future upgrades and online supports.
Paypal, Bank transfer and Bitcoin payments are welcome.
For more informaton please contact the author (DrGraph or Nimit Chomnawang, PhD) via TradingView private chat
or in the comment field below.
=================================================================================================
How to install the script:
------------------------------
*Go to the bottom of this page and click on "Add to Favorite Scripts".
*Remove older version Graph Reader Pro by clicking on the "X" botton behind the indicator line at the top left corner of the chart window.
*Open a new chart at and click on the "Indicators" tab.
*Click on the "Favorites" tab and choose "Graph Reader Pro 4.0".
*Right click anywhere on the graph, choose "Settings".
*In "Style" tab, choose the Dark Theme.
*In "Scales" tab, select Decimal Places = 1/100000.
*In "Background" tab, uncheck "Indicator Arguments" and "Indicator Values".
*In "Timezone/Sessions" tab, choose Time Zone = Your local time.
*At the bottom of settings window, click on "Template", "Save As...", then name this theme of graph setting for future call up such as "Graph Reader Pro".
*Click OK.
For free TradingView plan, you can add two more indicators to the chart. That means you may add RSI and MACD indicators with same parameters as those setup in Graph Reader Pro to your graph. DrGraph regularly publishes his educational ideas on using features provided in Graph Reader Pro for profitable investments. You can follow him for how to use the tools in trading stocks, forex, and binary options.






















